All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
To: Stefan Lippers-Hollmann <s.l-h@gmx.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	Linux Media Mailing List <linux-media@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [GIT PULL for v4.6-rc1] media updates
Date: Thu, 5 May 2016 08:07:37 -0300	[thread overview]
Message-ID: <20160505080737.5961617e@recife.lan> (raw)
In-Reply-To: <20160505010051.5b4149c8@mir>

[-- Attachment #1: Type: text/plain, Size: 5577 bytes --]

Em Thu, 5 May 2016 01:00:51 +0200
Stefan Lippers-Hollmann <s.l-h@gmx.de> escreveu:

> Hi
> 
> On 2016-05-04, Mauro Carvalho Chehab wrote:
> > Em Wed, 4 May 2016 13:49:52 -0700
> > Linus Torvalds <torvalds@linux-foundation.org> escreveu:  
> > > On Wed, May 4, 2016 at 12:28 PM, Stefan Lippers-Hollmann <s.l-h@gmx.de> wrote:    
> [...]
> > Stefan,
> > 
> > Could you please test the enclosed patch?
> > 
> > Regards,
> > Mauro
> > 
> > [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.
> > 
> > Compile-tested only.
> > 
> > So, change the logic to use, instead, IS_REACHABLE.
> > 
> > Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
> > 
> > diff --git a/drivers/media/media-device.c b/drivers/media/media-device.c
> > index b84825715f98..8c1f80ff33e3 100644
> > --- a/drivers/media/media-device.c
> > +++ b/drivers/media/media-device.c
> > @@ -842,11 +842,11 @@ struct media_device *media_device_find_devres(struct device *dev)
> >  }
> >  EXPORT_SYMBOL_GPL(media_device_find_devres);
> >  
> > +#if IS_REACHABLE(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)
> > @@ -862,16 +862,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_REACHABLE(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)
> > @@ -891,9 +891,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 */
> > 
> >   
> 
> This fails to build for me with:
> 
> [...]
> Setup is 16348 bytes (padded to 16384 bytes).
> System is 3319 kB
> CRC a9178215
> Kernel: arch/x86/boot/bzImage is ready  (#1)
> ERROR: "__media_device_usb_init" [drivers/media/usb/siano/smsusb.ko] undefined!
> ERROR: "__media_device_usb_init" [drivers/media/usb/em28xx/em28xx.ko] undefined!
> ERROR: "__media_device_usb_init" [drivers/media/usb/dvb-usb/dvb-usb.ko] undefined!
> ERROR: "__media_device_usb_init" [drivers/media/usb/dvb-usb-v2/dvb_usb_v2.ko] undefined!
> ERROR: "__media_device_usb_init" [drivers/media/usb/cx231xx/cx231xx.ko] undefined!
> ERROR: "__media_device_usb_init" [drivers/media/usb/au0828/au0828.ko] undefined!
> scripts/Makefile.modpost:91: recipe for target '__modpost' failed
> make[6]: *** [__modpost] Error 1
> Makefile:1147: recipe for target 'modules' failed
> [...]
> 
> I've attached my gzipped kernel configs for amd64 and i386.
> 
> Regards
> 	Stefan Lippers-Hollmann

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.

Tested with the following .config alternatives:

CONFIG_USB=m
CONFIG_MEDIA_CONTROLLER=y
CONFIG_MEDIA_SUPPORT=m
CONFIG_VIDEO_AU0828=m

CONFIG_USB=m
CONFIG_MEDIA_CONTROLLER=y
CONFIG_MEDIA_SUPPORT=y
CONFIG_VIDEO_AU0828=m

CONFIG_USB=y
CONFIG_MEDIA_CONTROLLER=y
CONFIG_MEDIA_SUPPORT=y
CONFIG_VIDEO_AU0828=m

CONFIG_USB=y
CONFIG_MEDIA_CONTROLLER=y
CONFIG_MEDIA_SUPPORT=y
CONFIG_VIDEO_AU0828=y

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>

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 */



Thanks,
Mauro

[-- Attachment #2: Assinatura digital OpenPGP --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2016-05-05 11:07 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-15 11:05 [GIT PULL for v4.6-rc1] media updates Mauro Carvalho Chehab
2016-05-03 21:38 ` Stefan Lippers-Hollmann
2016-05-03 21:53   ` Linus Torvalds
2016-05-04  4:39     ` Stefan Lippers-Hollmann
2016-05-04 17:58       ` Linus Torvalds
2016-05-04 19:28         ` Stefan Lippers-Hollmann
2016-05-04 20:49           ` Linus Torvalds
2016-05-04 21:45             ` Stefan Lippers-Hollmann
2016-05-04 21:51             ` Mauro Carvalho Chehab
2016-05-04 23:00               ` Stefan Lippers-Hollmann
2016-05-05 11:07                 ` Mauro Carvalho Chehab [this message]
2016-05-06  0:00                   ` Stefan Lippers-Hollmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160505080737.5961617e@recife.lan \
    --to=mchehab@osg.samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=s.l-h@gmx.de \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.