Message ID | 20160505080737.5961617e@recife.lan (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Hi On 2016-05-05, Mauro Carvalho Chehab wrote: > Em Thu, 5 May 2016 01:00:51 +0200 > Stefan Lippers-Hollmann <s.l-h@gmx.de> escreveu: [...] > Oh, in this case, it should be using IS_ENABLED() macro instead. > The following patch should fix it. I tested here with some different > setups, as described in the patch, and with your .i686 .config. > > Please double-check and ack if it is ok for you. > > Regards, > Mauro > > > [PATCH v2] [media] media-device: fix builds when USB or PCI is compiled > as module > > Just checking ifdef CONFIG_USB is not enough, if the USB is compiled > as module. The same applies to PCI. [...] This patch works for me, both on amd64 and i386, tested with dvb_usb_dw2102, dvb_usb_af9015 and dvb_usb_rtl28xxu. > Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Feel free to add Tested-by: Stefan Lippers-Hollmann <s.l-h@gmx.de> Thanks a lot. Regards Stefan Lippers-Hollmann
diff --git a/drivers/media/media-device.c b/drivers/media/media-device.c index 6e43c95629ea..3cfd7af8c5ca 100644 --- a/drivers/media/media-device.c +++ b/drivers/media/media-device.c @@ -846,11 +846,11 @@ struct media_device *media_device_find_devres(struct device *dev) } EXPORT_SYMBOL_GPL(media_device_find_devres); +#if IS_ENABLED(CONFIG_PCI) void media_device_pci_init(struct media_device *mdev, struct pci_dev *pci_dev, const char *name) { -#ifdef CONFIG_PCI mdev->dev = &pci_dev->dev; if (name) @@ -866,16 +866,16 @@ void media_device_pci_init(struct media_device *mdev, mdev->driver_version = LINUX_VERSION_CODE; media_device_init(mdev); -#endif } EXPORT_SYMBOL_GPL(media_device_pci_init); +#endif +#if IS_ENABLED(CONFIG_USB) void __media_device_usb_init(struct media_device *mdev, struct usb_device *udev, const char *board_name, const char *driver_name) { -#ifdef CONFIG_USB mdev->dev = &udev->dev; if (driver_name) @@ -895,9 +895,9 @@ void __media_device_usb_init(struct media_device *mdev, mdev->driver_version = LINUX_VERSION_CODE; media_device_init(mdev); -#endif } EXPORT_SYMBOL_GPL(__media_device_usb_init); +#endif #endif /* CONFIG_MEDIA_CONTROLLER */