From patchwork Tue Nov 8 15:15:48 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Hiremath, Vaibhav" X-Patchwork-Id: 8352 Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from ) id 1RNnPG-0007rG-Ew; Tue, 08 Nov 2011 16:16:10 +0100 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.75/mailfrontend-2) with esmtp id 1RNnP4-0003ZE-IK; Tue, 08 Nov 2011 16:15:59 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755855Ab1KHPP4 (ORCPT + 3 others); Tue, 8 Nov 2011 10:15:56 -0500 Received: from comal.ext.ti.com ([198.47.26.152]:49732 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755158Ab1KHPPz convert rfc822-to-8bit (ORCPT ); Tue, 8 Nov 2011 10:15:55 -0500 Received: from dbdp20.itg.ti.com ([172.24.170.38]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id pA8FFqd9001409 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 8 Nov 2011 09:15:54 -0600 Received: from DBDE71.ent.ti.com (localhost [127.0.0.1]) by dbdp20.itg.ti.com (8.13.8/8.13.8) with ESMTP id pA8FFnhG024779; Tue, 8 Nov 2011 20:45:49 +0530 (IST) Received: from DBDE01.ent.ti.com ([fe80::d5df:c4b5:9919:4e10]) by DBDE71.ent.ti.com ([fe80::692c:15fd:9507:b54%21]) with mapi id 14.01.0323.003; Tue, 8 Nov 2011 20:45:49 +0530 From: "Hiremath, Vaibhav" To: "Valkeinen, Tomi" , "linux-media@vger.kernel.org" CC: "Taneja, Archit" Subject: RE: [PATCH] omap_vout: fix section mismatch Thread-Topic: [PATCH] omap_vout: fix section mismatch Thread-Index: AQHMnftwIDKCSR0hnkqbWWNRugmbD5WjCpfQ Date: Tue, 8 Nov 2011 15:15:48 +0000 Message-ID: <79CD15C6BA57404B839C016229A409A802693C@DBDE01.ent.ti.com> References: <1320745628-20603-1-git-send-email-tomi.valkeinen@ti.com> In-Reply-To: <1320745628-20603-1-git-send-email-tomi.valkeinen@ti.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.24.170.142] MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-PMX-Version: 5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2011.11.8.150016 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' MSGID_ADDED_BY_MTA 0.05, BODY_SIZE_3000_3999 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, WEBMAIL_SOURCE 0, WEBMAIL_XOIP 0, WEBMAIL_X_IP_HDR 0, __ANY_URI 0, __BOUNCE_CHALLENGE_SUBJ 0, __BOUNCE_NDR_SUBJ_EXEMPT 0, __CP_MEDIA_BODY 0, __CP_URI_IN_BODY 0, __CT 0, __CTE 0, __CT_TEXT_PLAIN 0, __HAS_MSGID 0, __HAS_XOIP 0, __HAS_X_MAILING_LIST 0, __IMS_MSGID 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __SANE_MSGID 0, __SUBJ_ALPHA_END 0, __TO_MALFORMED_2 0, __URI_NO_WWW 0, __URI_NS ' X-LSpam-Score: -4.2 (----) X-LSpam-Report: No, score=-4.2 required=5.0 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3 autolearn=ham > -----Original Message----- > From: Valkeinen, Tomi > Sent: Tuesday, November 08, 2011 3:17 PM > To: linux-media@vger.kernel.org; Hiremath, Vaibhav > Cc: Taneja, Archit; Valkeinen, Tomi > Subject: [PATCH] omap_vout: fix section mismatch > > Fix the following warning by using platform_driver_probe() instead of > platform_driver_register(): > > WARNING: drivers/media/video/omap/omap-vout.o(.data+0x24): Section > mismatch in reference from the variable omap_vout_driver to the function > .init.text:omap_vout_probe() > The variable omap_vout_driver references > the function __init omap_vout_probe() > > Signed-off-by: Tomi Valkeinen > --- > drivers/media/video/omap/omap_vout.c | 3 +-- > 1 files changed, 1 insertions(+), 2 deletions(-) > > diff --git a/drivers/media/video/omap/omap_vout.c > b/drivers/media/video/omap/omap_vout.c > index 9c5c19f..a323c09 100644 > --- a/drivers/media/video/omap/omap_vout.c > +++ b/drivers/media/video/omap/omap_vout.c > @@ -2254,13 +2254,12 @@ static struct platform_driver omap_vout_driver = { > .driver = { > .name = VOUT_NAME, > }, > - .probe = omap_vout_probe, > .remove = omap_vout_remove, > }; > > static int __init omap_vout_init(void) > { > - if (platform_driver_register(&omap_vout_driver) != 0) { > + if (platform_driver_probe(&omap_vout_driver, omap_vout_probe) != 0) > { > printk(KERN_ERR VOUT_NAME ":Could not register Video > driver\n"); > return -EINVAL; > } > -- > 1.7.4.1 Thanks Tomi, Acked-by: Vaibhav Hiremath Tested-by: Vaibhav Hiremath Not related to this patch, but thought of putting it here for Wider audience. I am not sure whether you had tested it, but kernel doesn't boot with V4L2 display enabled in defconfig. I have patch to fix this, will submit shortly - Reason being, If you have enabled certain device and fail to enable in defconfig, this will lead to kernel crash in omap_vout driver. Thanks, Vaibhav --- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/media/video/omap/omap_vout.c b/drivers/media/video/omap/omap_vout.c index 9c5c19f..9031c39 100644 --- a/drivers/media/video/omap/omap_vout.c +++ b/drivers/media/video/omap/omap_vout.c @@ -2140,6 +2140,8 @@ static int omap_vout_remove(struct platform_device *pdev) omap_vout_cleanup_device(vid_dev->vouts[k]); for (k = 0; k < vid_dev->num_displays; k++) { + if (!vid_dev->displays[k] && !vid_dev->displays[k]->driver) + continue; if (vid_dev->displays[k]->state != OMAP_DSS_DISPLAY_DISABLED) vid_dev->displays[k]->driver->disable(vid_dev->displays[k]); @@ -2226,7 +2228,7 @@ static int __init omap_vout_probe(struct platform_device *pdev) for (i = 0; i < vid_dev->num_displays; i++) { struct omap_dss_device *display = vid_dev->displays[i]; - if (display->driver->update) + if (display && display->driver && display->driver->update) display->driver->update(display, 0, 0, display->panel.timings.x_res, display->panel.timings.y_res);