From 447a7f934e82284bc0cd3270f6491412fcab3f6d Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9my=20Lefaure?= Date: Mon, 20 Mar 2017 22:48:26 -0400 Subject: [PATCH] staging: media: atomisp: fix build errors when PM is disabled MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The function atomisp_restore_iumit_reg is unused when PM is disabled. Adding __maybe_unused to the function definition avoids a warning. The function atomisp_mrfld_power_down is defined only when PM is enabled. So in atomisp_pci_probe, it should be called only when PM is enabled. Signed-off-by: Jérémy Lefaure Signed-off-by: Greg Kroah-Hartman --- drivers/staging/media/atomisp/pci/atomisp2/atomisp_v4l2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_v4l2.c b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_v4l2.c index 20b4097..626d2f1 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_v4l2.c +++ b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_v4l2.c @@ -264,7 +264,7 @@ static int atomisp_save_iunit_reg(struct atomisp_device *isp) return 0; } -static int atomisp_restore_iunit_reg(struct atomisp_device *isp) +static int __maybe_unused atomisp_restore_iunit_reg(struct atomisp_device *isp) { struct pci_dev *dev = isp->pdev; @@ -1526,7 +1526,7 @@ load_fw_fail: atomisp_ospm_dphy_down(isp); /* Address later when we worry about the ...field chips */ - if (atomisp_mrfld_power_down(isp)) + if (IS_ENABLED(CONFIG_PM) && atomisp_mrfld_power_down(isp)) dev_err(&dev->dev, "Failed to switch off ISP\n"); pci_dev_put(isp->pci_root); return err; -- 2.7.4