All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nathan Chancellor <nathan@kernel.org>
To: Jacopo Mondi <jacopo+renesas@jmondi.org>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	linux-media@vger.kernel.org, linux-next@vger.kernel.org,
	linux-renesas-soc@vger.kernel.org,
	Stephen Rothwell <sfr@canb.auug.org.au>
Subject: Re: [PATCH] media: i2c: Kconfig: Make MAX9271 a module
Date: Tue, 9 Feb 2021 16:24:13 -0700	[thread overview]
Message-ID: <20210209232413.GA673593@ubuntu-m3-large-x86> (raw)
In-Reply-To: <20210208182006.178740-1-jacopo+renesas@jmondi.org>

On Mon, Feb 08, 2021 at 07:20:06PM +0100, Jacopo Mondi wrote:
> With the introduction of the RDACM21 camera module support in
> commit a59f853b3b4b ("media: i2c: Add driver for RDACM21 camera module")
> the symbols defined by the max9271 library were exported twice
> if multiple users of the library were compiled in at the same time.
> 
> In example:
> WARNING: modpost: drivers/media/i2c/rdacm21-camera_module:
> 'max9271_set_serial_link' exported twice. Previous export was in
> drivers/media/i2c/rdacm20-camera_module.ko
> 
> Fix this by making the rdacm21 file a module and have the driver
> using its functions select it.
> 
> Fixes: a59f853b3b4b ("media: i2c: Add driver for RDACM21 camera module")
> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> Suggested-by: Mauro Carvalho Chehab <mchehab@kernel.org>
> Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>

That file needs a MODULE_LICENSE now otherwise there will be a fatal
build error:

ERROR: modpost: missing MODULE_LICENSE() in drivers/media/i2c/max9271.o

Cheers,
Nathan

> ---
>  drivers/media/i2c/Kconfig  | 5 +++++
>  drivers/media/i2c/Makefile | 7 +++----
>  2 files changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/media/i2c/Kconfig b/drivers/media/i2c/Kconfig
> index 2d3dc0d82f9e..84645f751da3 100644
> --- a/drivers/media/i2c/Kconfig
> +++ b/drivers/media/i2c/Kconfig
> @@ -1240,12 +1240,16 @@ config VIDEO_NOON010PC30
> 
>  source "drivers/media/i2c/m5mols/Kconfig"
> 
> +config VIDEO_MAX9271
> +	tristate
> +
>  config VIDEO_RDACM20
>  	tristate "IMI RDACM20 camera support"
>  	depends on I2C
>  	select V4L2_FWNODE
>  	select VIDEO_V4L2_SUBDEV_API
>  	select MEDIA_CONTROLLER
> +	select VIDEO_MAX9271
>  	help
>  	  This driver supports the IMI RDACM20 GMSL camera, used in
>  	  ADAS systems.
> @@ -1259,6 +1263,7 @@ config VIDEO_RDACM21
>  	select V4L2_FWNODE
>  	select VIDEO_V4L2_SUBDEV_API
>  	select MEDIA_CONTROLLER
> +	select VIDEO_MAX9271
>  	help
>  	  This driver supports the IMI RDACM21 GMSL camera, used in
>  	  ADAS systems.
> diff --git a/drivers/media/i2c/Makefile b/drivers/media/i2c/Makefile
> index 6bd22d63e1a7..c34a7de3158b 100644
> --- a/drivers/media/i2c/Makefile
> +++ b/drivers/media/i2c/Makefile
> @@ -125,10 +125,9 @@ obj-$(CONFIG_VIDEO_IMX319)	+= imx319.o
>  obj-$(CONFIG_VIDEO_IMX334)	+= imx334.o
>  obj-$(CONFIG_VIDEO_IMX355)	+= imx355.o
>  obj-$(CONFIG_VIDEO_MAX9286)	+= max9286.o
> -rdacm20-camera_module-objs	:= rdacm20.o max9271.o
> -obj-$(CONFIG_VIDEO_RDACM20)	+= rdacm20-camera_module.o
> -rdacm21-camera_module-objs	:= rdacm21.o max9271.o
> -obj-$(CONFIG_VIDEO_RDACM21)	+= rdacm21-camera_module.o
> +obj-$(CONFIG_VIDEO_MAX9271)	+= max9271.o
> +obj-$(CONFIG_VIDEO_RDACM20)	+= rdacm20.o
> +obj-$(CONFIG_VIDEO_RDACM21)	+= rdacm21.o
>  obj-$(CONFIG_VIDEO_ST_MIPID02) += st-mipid02.o
> 
>  obj-$(CONFIG_SDR_MAX2175) += max2175.o
> --
> 2.30.0
> 

      parent reply	other threads:[~2021-02-10  0:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-08 18:20 [PATCH] media: i2c: Kconfig: Make MAX9271 a module Jacopo Mondi
2021-02-08 20:21 ` Sakari Ailus
2021-02-08 22:26   ` Laurent Pinchart
2021-02-09  8:48     ` Sakari Ailus
2021-02-08 20:42 ` Geert Uytterhoeven
2021-02-09 23:24 ` Nathan Chancellor [this message]

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=20210209232413.GA673593@ubuntu-m3-large-x86 \
    --to=nathan@kernel.org \
    --cc=jacopo+renesas@jmondi.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    --cc=sfr@canb.auug.org.au \
    /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.