From patchwork Thu Oct 4 22:13:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 10626941 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BC8801731 for ; Thu, 4 Oct 2018 22:13:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ADD1A2951F for ; Thu, 4 Oct 2018 22:13:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A21A429524; Thu, 4 Oct 2018 22:13:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1E6BF2951F for ; Thu, 4 Oct 2018 22:13:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726113AbeJEFJV (ORCPT ); Fri, 5 Oct 2018 01:09:21 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:46276 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725883AbeJEFJU (ORCPT ); Fri, 5 Oct 2018 01:09:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Sender:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=qqt2lVL882vacSjG2RFvP6krOjkTwXuBgEZq9zglqyA=; b=Qj7fk/06iTrauJDqg2RyLNoH5 +Pomolu8yBhvq/QUnRTtdI1Yp//QbdIgzK1KYxREa0dsr+8l4qtolOxA/i7JfQtYeAuYG74Qil0Io ov9CNzDh8zWINOQU8NG6Ah7mP3NXaGcb7G5kn5DQg5L+rgoCGgtZhkbINFJf5dBJrY6FzGjXMb01l fFpNKgyPnfb3thQhtcdmsf6xfa5AGYSn2gGK4kELKV6+Z3OmLjtxiHMI2AC1z4Saa7a4OlkGS53Ow 3nQkRYvL1rN2jJmhqHvmcv/nl9J1KgTrVtSmfZf8wzm/iDH1FgSt0dyGcqxgKCZRbjbl+VF+fLR28 Y7rBolhOw==; Received: from [179.95.46.242] (helo=bombadil.infradead.org) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1g8BsW-0003Eg-Mb; Thu, 04 Oct 2018 22:13:52 +0000 Received: from mchehab by bombadil.infradead.org with local (Exim 4.91) (envelope-from ) id 1g8BsT-0000kY-M5; Thu, 04 Oct 2018 18:13:49 -0400 From: Mauro Carvalho Chehab Cc: Mauro Carvalho Chehab , Linux Media Mailing List , Mauro Carvalho Chehab , Sakari Ailus , =?utf-8?q?Niklas_S=C3=B6derlun?= =?utf-8?q?d?= , Hans Verkuil , Sebastian Reichel , Steve Longerbeam Subject: [PATCH 2/3] media: v4l2-fwnode: cleanup functions that parse endpoints Date: Thu, 4 Oct 2018 18:13:47 -0400 Message-Id: <19c5acc2b8c64b37005a6934f6f54b32cf93c0dc.1538690587.git.mchehab+samsung@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: In-Reply-To: References: To: unlisted-recipients:; (no To-header on input) Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP There is already a typedef for the parse endpoint function. However, instead of using it, it is redefined at the C file (and on one of the function headers). Replace them by the function typedef, in order to cleanup several related coding style warnings. Signed-off-by: Mauro Carvalho Chehab --- drivers/media/v4l2-core/v4l2-fwnode.c | 64 ++++++++++++--------------- include/media/v4l2-fwnode.h | 19 ++++---- 2 files changed, 37 insertions(+), 46 deletions(-) diff --git a/drivers/media/v4l2-core/v4l2-fwnode.c b/drivers/media/v4l2-core/v4l2-fwnode.c index 4e518d5fddd8..a7c2487154a4 100644 --- a/drivers/media/v4l2-core/v4l2-fwnode.c +++ b/drivers/media/v4l2-core/v4l2-fwnode.c @@ -596,12 +596,10 @@ EXPORT_SYMBOL_GPL(v4l2_fwnode_put_link); static int v4l2_async_notifier_fwnode_parse_endpoint(struct device *dev, - struct v4l2_async_notifier *notifier, - struct fwnode_handle *endpoint, - unsigned int asd_struct_size, - int (*parse_endpoint)(struct device *dev, - struct v4l2_fwnode_endpoint *vep, - struct v4l2_async_subdev *asd)) + struct v4l2_async_notifier *notifier, + struct fwnode_handle *endpoint, + unsigned int asd_struct_size, + parse_endpoint_func parse_endpoint) { struct v4l2_fwnode_endpoint vep = { .bus_type = 0 }; struct v4l2_async_subdev *asd; @@ -657,13 +655,12 @@ v4l2_async_notifier_fwnode_parse_endpoint(struct device *dev, } static int -__v4l2_async_notifier_parse_fwnode_endpoints(struct device *dev, - struct v4l2_async_notifier *notifier, - size_t asd_struct_size, - unsigned int port, bool has_port, - int (*parse_endpoint)(struct device *dev, - struct v4l2_fwnode_endpoint *vep, - struct v4l2_async_subdev *asd)) +__v4l2_async_notifier_parse_fwnode_ep(struct device *dev, + struct v4l2_async_notifier *notifier, + size_t asd_struct_size, + unsigned int port, + bool has_port, + parse_endpoint_func parse_endpoint) { struct fwnode_handle *fwnode; int ret = 0; @@ -708,31 +705,27 @@ __v4l2_async_notifier_parse_fwnode_endpoints(struct device *dev, int v4l2_async_notifier_parse_fwnode_endpoints(struct device *dev, - struct v4l2_async_notifier *notifier, - size_t asd_struct_size, - int (*parse_endpoint)(struct device *dev, - struct v4l2_fwnode_endpoint *vep, - struct v4l2_async_subdev *asd)) + struct v4l2_async_notifier *notifier, + size_t asd_struct_size, + parse_endpoint_func parse_endpoint) { - return __v4l2_async_notifier_parse_fwnode_endpoints(dev, notifier, - asd_struct_size, 0, - false, - parse_endpoint); + return __v4l2_async_notifier_parse_fwnode_ep(dev, notifier, + asd_struct_size, 0, + false, parse_endpoint); } EXPORT_SYMBOL_GPL(v4l2_async_notifier_parse_fwnode_endpoints); int v4l2_async_notifier_parse_fwnode_endpoints_by_port(struct device *dev, - struct v4l2_async_notifier *notifier, - size_t asd_struct_size, unsigned int port, - int (*parse_endpoint)(struct device *dev, - struct v4l2_fwnode_endpoint *vep, - struct v4l2_async_subdev *asd)) + struct v4l2_async_notifier *notifier, + size_t asd_struct_size, + unsigned int port, + parse_endpoint_func parse_endpoint) { - return __v4l2_async_notifier_parse_fwnode_endpoints(dev, notifier, - asd_struct_size, - port, true, - parse_endpoint); + return __v4l2_async_notifier_parse_fwnode_ep(dev, notifier, + asd_struct_size, + port, true, + parse_endpoint); } EXPORT_SYMBOL_GPL(v4l2_async_notifier_parse_fwnode_endpoints_by_port); @@ -1176,11 +1169,10 @@ int v4l2_async_register_subdev_sensor_common(struct v4l2_subdev *sd) EXPORT_SYMBOL_GPL(v4l2_async_register_subdev_sensor_common); int v4l2_async_register_fwnode_subdev(struct v4l2_subdev *sd, - size_t asd_struct_size, - unsigned int *ports, unsigned int num_ports, - int (*parse_endpoint)(struct device *dev, - struct v4l2_fwnode_endpoint *vep, - struct v4l2_async_subdev *asd)) + size_t asd_struct_size, + unsigned int *ports, + unsigned int num_ports, + parse_endpoint_func parse_endpoint) { struct v4l2_async_notifier *notifier; struct device *dev = sd->dev; diff --git a/include/media/v4l2-fwnode.h b/include/media/v4l2-fwnode.h index 21b3f9e5c269..6d9d9f1839ac 100644 --- a/include/media/v4l2-fwnode.h +++ b/include/media/v4l2-fwnode.h @@ -346,9 +346,10 @@ v4l2_async_notifier_parse_fwnode_endpoints(struct device *dev, */ int v4l2_async_notifier_parse_fwnode_endpoints_by_port(struct device *dev, - struct v4l2_async_notifier *notifier, - size_t asd_struct_size, unsigned int port, - parse_endpoint_func parse_endpoint); + struct v4l2_async_notifier *notifier, + size_t asd_struct_size, + unsigned int port, + parse_endpoint_func parse_endpoint); /** * v4l2_fwnode_reference_parse_sensor_common - parse common references on @@ -369,7 +370,7 @@ v4l2_async_notifier_parse_fwnode_endpoints_by_port(struct device *dev, * -EINVAL if property parsing failed */ int v4l2_async_notifier_parse_fwnode_sensor_common(struct device *dev, - struct v4l2_async_notifier *notifier); + struct v4l2_async_notifier *notifier); /** * v4l2_async_register_fwnode_subdev - registers a sub-device to the @@ -403,11 +404,9 @@ int v4l2_async_notifier_parse_fwnode_sensor_common(struct device *dev, */ int v4l2_async_register_fwnode_subdev(struct v4l2_subdev *sd, - size_t asd_struct_size, - unsigned int *ports, - unsigned int num_ports, - int (*parse_endpoint)(struct device *dev, - struct v4l2_fwnode_endpoint *vep, - struct v4l2_async_subdev *asd)); + size_t asd_struct_size, + unsigned int *ports, + unsigned int num_ports, + parse_endpoint_func parse_endpoint); #endif /* _V4L2_FWNODE_H */