Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 447a7f93 authored by Jérémy Lefaure's avatar Jérémy Lefaure Committed by Greg Kroah-Hartman
Browse files

staging: media: atomisp: fix build errors when PM is disabled



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: default avatarJérémy Lefaure <jeremy.lefaure@lse.epita.fr>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 435ec8af
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -264,7 +264,7 @@ static int atomisp_save_iunit_reg(struct atomisp_device *isp)
	return 0;
	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;
	struct pci_dev *dev = isp->pdev;


@@ -1526,7 +1526,7 @@ static int atomisp_pci_probe(struct pci_dev *dev,
	atomisp_ospm_dphy_down(isp);
	atomisp_ospm_dphy_down(isp);


	/* Address later when we worry about the ...field chips */
	/* 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");
		dev_err(&dev->dev, "Failed to switch off ISP\n");
	pci_dev_put(isp->pci_root);
	pci_dev_put(isp->pci_root);
	return err;
	return err;