From patchwork Fri May 25 15:25:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 136946 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp3731244lji; Fri, 25 May 2018 08:26:56 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpXNMl+K6/rEgvv3K0K8FjjKaSHn4xSxnzyLHunrpfRoi0i5jYxszuLv8lI1lPy3RY3zmv0 X-Received: by 2002:a63:7d43:: with SMTP id m3-v6mr2396456pgn.117.1527262016773; Fri, 25 May 2018 08:26:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527262016; cv=none; d=google.com; s=arc-20160816; b=gsFkaOuVBTSiyZ6OFhQPvfY5fWuqWKN6WwtSDx5xVyfdN3M9hq1DFU//rsNCsUILU3 up8Cf7pgyDydESZ25xTF71e9vGOgjkcR/STCI8t3O28V+yUXJPsMUtstBZj0VaTdU1z3 78D2fLv1lZV/ngoP1Fkt745OycMVPaPZCWm3CF4G2Y7JcXHZMOflHRXCf6bJ4Xb6gxd9 RcaFq33zNHFlnHpAO6vUYe2Zimo2fXe70WiWaYT/g7Ugyp7mWmmdC8GCpJsH+tBlg5KQ 9u9CQxpXnQEwiB1lTBikrYuJtXPsSZlMmfVz6mxnth3aZcODWKMyyDN5dyfm83zTpUaO Ewyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=yoZ3LlhZD3cxDQ3ME/3SgCIAG375VWdpVREOiI7Shmw=; b=a4UTFeR+Rezp/hMjv5fwTMIFnLER5YM7IozNk2aceObEeP1PSFprtaXq7l1qf/3DzO jawcTfiuSO9zaJc5wge1xnqmWW1Wx+NykUCLLO5HycnXnW87HIUH8Gb7wCcc3vosheu6 aIPrjk4jK3I9Z++/AXaK9wIRV8M5MX8fGN1fUQrtARH+Vcm9MHXnPuRLOrlg3wHFNJf4 /24fYmW1whFlQ0lhojGkbpsYXLyM7BwnZ2GQ5yM+gBW7nbtPWCPOeE1FQpJ5WiUlAKbo Nu0JTo2VK2d+LNBLtVaG5PUoE+LIEKaN2xYWYVz0phSZf+sjhBKYxRZi8soRFWWYVmr8 AeSg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n61-v6si24172104plb.256.2018.05.25.08.26.56; Fri, 25 May 2018 08:26:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966712AbeEYP0y (ORCPT + 30 others); Fri, 25 May 2018 11:26:54 -0400 Received: from mout.kundenserver.de ([212.227.126.134]:40127 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966018AbeEYP0u (ORCPT ); Fri, 25 May 2018 11:26:50 -0400 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue001 [212.227.15.129]) with ESMTPA (Nemesis) id 0MXzB1-1ft0hw2vF1-00WmXx; Fri, 25 May 2018 17:26:35 +0200 From: Arnd Bergmann To: Jonathan Corbet , Mauro Carvalho Chehab Cc: Arnd Bergmann , Philippe Ombredanne , Bhumika Goyal , Sakari Ailus , Hans Verkuil , Greg Kroah-Hartman , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/5] media: marvel-ccic: allow ccic and mmp drivers to coexist Date: Fri, 25 May 2018 17:25:11 +0200 Message-Id: <20180525152523.2821369-4-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20180525152523.2821369-1-arnd@arndb.de> References: <20180525152523.2821369-1-arnd@arndb.de> X-Provags-ID: V03:K1:HOVlfreSyqqznhiA4hm8zrijy4s0I5qMaH8mQOSLFPB2k2t2TbI 59nb/JyhDJI5gVS4UKGduMUUITLFfPm20bLDrOWPN0lZPl40wXWyXUUPHOWNej9Hcml8Vi2 6d5rJZxDexHRqnUfTSyZZSIbqvv9VKB9MGpvWRmC/isYmT9/V/Au5fyYXseBTEqJPpYoCf1 qfAUuWQxtHBifNnsK/esg== X-UI-Out-Filterresults: notjunk:1; V01:K0:jljPvD3mKN0=:jspWfsIRf1Lqk9UdctfvG4 AQF8fOhYrulbLyuTYYxSGksMH4iao6+a3V5xfBQX8sdjZrItN47x2ZarS7RwYsY3lMj26dIsD 5yhIdQqIshjQ7pKtF0c07GLKgnmDhyUTa1V7sOLT80l/V+44nLk+BWIFIJ0BKTKZWa5iF5Sm+ 0zJM8Y34t2hyWTC2eaxl84zREj4M7owWNIVVeveebENWfa7Z/3+QShk1ZLYJz0fKGJ4JCWUnp qQz6rhxqca9gU1AfWMANxC5pt64uIKJF7n4m5QrtjpeISUGyFtw4P2Uw9Gq1Fy3fo7WPqw7sK D2nr4mskneFfBiu2L/YHKB9jI0jOGhKKCXf4rbcN9TV+ZGBjsahVQPHhdLhwOCpVUcaoyth/j 0xGhKQhveypcse+s+PpKIYLzn6gVw5eIv74hF2D6oM7N5ZTE2jU0XdSJrjfLUNS9b8BLf0bbt BfCpfF2WgeRGVquqTeq65KOvdOvsrRRcw41Mga4HGfOy9omidD4E5m/GBVrSUN6N/Ri1M4af4 WkCa8iiS2UKwMWApl2nUOtw6iZ9KjMx1XeVoa1K85LA+TYP9D0y/cWN52La/xrppI+CJXrS5I gEJYjr28kc+YQaK156CVrFuoIPjty5ousW5ecqfONQO2kFXMIfURUgyz/EUcpjunqZa26yHFx tCv7HCmU8OBS459qZA6gO18z2HXLO5hFjRaaCZHDT1xu882FUI1Qvhnvtsp+mh/sQ+gc= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Randconfig builds fail when one of the two is a built-in driver and the other one is a loadable module: drivers/media/platform/marvell-ccic/mcam-core.o: In function `mccic_register': mcam-core.c:(.text+0x2594): undefined reference to `__this_module' drivers/media/platform/marvell-ccic/mcam-core.o:(.rodata+0x50): undefined reference to `__this_module' The problem is that mcam-core.c can not be built both ways at the smae time. However, we can make kbuild take care of that by making the core driver a separate module, which can be either built-in or loadable as needed. Making it a separate module requires exporting a few symbols and adding the module license from the header. Fixes: 0a9c643c8faa ("media: marvel-ccic: re-enable mmp-driver build") Signed-off-by: Arnd Bergmann --- drivers/media/platform/marvell-ccic/Makefile | 9 ++++----- drivers/media/platform/marvell-ccic/mcam-core.c | 9 ++++++++- 2 files changed, 12 insertions(+), 6 deletions(-) -- 2.9.0 diff --git a/drivers/media/platform/marvell-ccic/Makefile b/drivers/media/platform/marvell-ccic/Makefile index 05a792c579a2..b3a4d0cdccb8 100644 --- a/drivers/media/platform/marvell-ccic/Makefile +++ b/drivers/media/platform/marvell-ccic/Makefile @@ -1,6 +1,5 @@ -obj-$(CONFIG_VIDEO_CAFE_CCIC) += cafe_ccic.o -cafe_ccic-y := cafe-driver.o mcam-core.o - -obj-$(CONFIG_VIDEO_MMP_CAMERA) += mmp_camera.o -mmp_camera-y := mmp-driver.o mcam-core.o +obj-$(CONFIG_VIDEO_CAFE_CCIC) += cafe_ccic.o mcam-core.o +cafe_ccic-y := cafe-driver.o +obj-$(CONFIG_VIDEO_MMP_CAMERA) += mmp_camera.o mcam-core.o +mmp_camera-y := mmp-driver.o diff --git a/drivers/media/platform/marvell-ccic/mcam-core.c b/drivers/media/platform/marvell-ccic/mcam-core.c index 80670eeee142..dfdbd4354b74 100644 --- a/drivers/media/platform/marvell-ccic/mcam-core.c +++ b/drivers/media/platform/marvell-ccic/mcam-core.c @@ -1720,6 +1720,7 @@ int mccic_irq(struct mcam_camera *cam, unsigned int irqs) } return handled; } +EXPORT_SYMBOL_GPL(mccic_irq); /* ---------------------------------------------------------------------- */ /* @@ -1830,7 +1831,7 @@ int mccic_register(struct mcam_camera *cam) v4l2_device_unregister(&cam->v4l2_dev); return ret; } - +EXPORT_SYMBOL_GPL(mccic_register); void mccic_shutdown(struct mcam_camera *cam) { @@ -1850,6 +1851,7 @@ void mccic_shutdown(struct mcam_camera *cam) v4l2_ctrl_handler_free(&cam->ctrl_handler); v4l2_device_unregister(&cam->v4l2_dev); } +EXPORT_SYMBOL_GPL(mccic_shutdown); /* * Power management @@ -1868,6 +1870,7 @@ void mccic_suspend(struct mcam_camera *cam) } mutex_unlock(&cam->s_mutex); } +EXPORT_SYMBOL_GPL(mccic_suspend); int mccic_resume(struct mcam_camera *cam) { @@ -1898,4 +1901,8 @@ int mccic_resume(struct mcam_camera *cam) } return ret; } +EXPORT_SYMBOL_GPL(mccic_resume); #endif /* CONFIG_PM */ + +MODULE_LICENSE("GPL v2"); +MODULE_AUTHOR("Jonathan Corbet ");