From patchwork Mon Sep 21 16:23:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 255696 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 53EDCC43468 for ; Mon, 21 Sep 2020 16:24:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 004852076B for ; Mon, 21 Sep 2020 16:23:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705440; bh=BWncN5L8Bc4Xtu/OJ3n9FqXOqZMQ9GY5uKsGG0hwNkA=; h=From:To:Cc:Subject:Date:List-ID:From; b=HZATSvzSMSM5WIcEIwxdvB2yDc6yk/2q0F74v1iEyhWiTwZALXWx6K28nzaZMvVvP IcoYmzO1hm9Y5oaHlzY/AgRnYXmN/YqMaOYrz+lY3X1eDCjuA0zgXjCE6egmpJcPpW RSY1Yu9oKVeg7MtbpY/Bu8Xbt/3NXVWHq7/Qzzj4= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728165AbgIUQX4 (ORCPT ); Mon, 21 Sep 2020 12:23:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:50630 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728110AbgIUQX4 (ORCPT ); Mon, 21 Sep 2020 12:23:56 -0400 Received: from localhost.localdomain (unknown [194.230.155.191]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 76B8A206BE; Mon, 21 Sep 2020 16:23:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705435; bh=BWncN5L8Bc4Xtu/OJ3n9FqXOqZMQ9GY5uKsGG0hwNkA=; h=From:To:Cc:Subject:Date:From; b=1Ijx6Wx3fvDAlv4k/DdM/1ziEqJnX311SiwlDFkZ1WQ7fUzSjQFd5l4cB2zv5cMAm SnWxU6ex5j2lVYT/XR12ObDsClZtFgjgCVjOwBMzSNUCBnXWQTS9LCbVs0RUwDsW1y vV7QI1duz99ylhL/oRly3BtAbB7mtuKSduQH53So= From: Krzysztof Kozlowski To: Pavel Machek , Sakari Ailus , Mauro Carvalho Chehab , Lars-Peter Clausen , Tianshu Qiu , Dongchun Zhu , Shawn Tu , Ricardo Ribalda , Dave Stevenson , Manivannan Sadhasivam , Bingbu Cao , Rui Miguel Silva , Shunqian Zheng , Chiranjeevi Rapolu , Hyungwoo Yang , Wenyou Yang , Hans Verkuil , Marco Felsch , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Krzysztof Kozlowski Subject: [PATCH 01/25] media: i2c: imx214: simplify getting state container Date: Mon, 21 Sep 2020 18:23:18 +0200 Message-Id: <20200921162342.7348-1-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The pointer to 'struct v4l2_subdev' is stored in drvdata via v4l2_i2c_subdev_init() so there is no point of a dance like: struct i2c_client *client = to_i2c_client(struct device *dev) struct v4l2_subdev *sd = i2c_get_clientdata(client); This allows to remove local variable 'client' and few pointer dereferences. White at it, use 'dev' directly instead of 'imx214->dev'. Signed-off-by: Krzysztof Kozlowski --- drivers/media/i2c/imx214.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/drivers/media/i2c/imx214.c b/drivers/media/i2c/imx214.c index 1ef5af9a8c8b..dc27c3678f18 100644 --- a/drivers/media/i2c/imx214.c +++ b/drivers/media/i2c/imx214.c @@ -431,14 +431,13 @@ static inline struct imx214 *to_imx214(struct v4l2_subdev *sd) static int __maybe_unused imx214_power_on(struct device *dev) { - struct i2c_client *client = to_i2c_client(dev); - struct v4l2_subdev *sd = i2c_get_clientdata(client); + struct v4l2_subdev *sd = dev_get_drvdata(dev); struct imx214 *imx214 = to_imx214(sd); int ret; ret = regulator_bulk_enable(IMX214_NUM_SUPPLIES, imx214->supplies); if (ret < 0) { - dev_err(imx214->dev, "failed to enable regulators: %d\n", ret); + dev_err(dev, "failed to enable regulators: %d\n", ret); return ret; } @@ -447,7 +446,7 @@ static int __maybe_unused imx214_power_on(struct device *dev) ret = clk_prepare_enable(imx214->xclk); if (ret < 0) { regulator_bulk_disable(IMX214_NUM_SUPPLIES, imx214->supplies); - dev_err(imx214->dev, "clk prepare enable failed\n"); + dev_err(dev, "clk prepare enable failed\n"); return ret; } @@ -459,8 +458,7 @@ static int __maybe_unused imx214_power_on(struct device *dev) static int __maybe_unused imx214_power_off(struct device *dev) { - struct i2c_client *client = to_i2c_client(dev); - struct v4l2_subdev *sd = i2c_get_clientdata(client); + struct v4l2_subdev *sd = dev_get_drvdata(dev); struct imx214 *imx214 = to_imx214(sd); gpiod_set_value_cansleep(imx214->enable_gpio, 0); @@ -910,8 +908,7 @@ static int imx214_parse_fwnode(struct device *dev) static int __maybe_unused imx214_suspend(struct device *dev) { - struct i2c_client *client = to_i2c_client(dev); - struct v4l2_subdev *sd = i2c_get_clientdata(client); + struct v4l2_subdev *sd = dev_get_drvdata(dev); struct imx214 *imx214 = to_imx214(sd); if (imx214->streaming) @@ -922,8 +919,7 @@ static int __maybe_unused imx214_suspend(struct device *dev) static int __maybe_unused imx214_resume(struct device *dev) { - struct i2c_client *client = to_i2c_client(dev); - struct v4l2_subdev *sd = i2c_get_clientdata(client); + struct v4l2_subdev *sd = dev_get_drvdata(dev); struct imx214 *imx214 = to_imx214(sd); int ret; From patchwork Mon Sep 21 16:23:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 255695 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C579EC43465 for ; Mon, 21 Sep 2020 16:24:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7A6FD22B2D for ; Mon, 21 Sep 2020 16:24:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705454; bh=k7zLMCQ9i2/JBhUqe/oTadHZU3FhlPAS2kI1B02f/EI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=kfIap1bVQ0X7l7iLjKJzQp/KOa6gEG0UD3FtU23ZLPaz3BQRf4mcTRtF5D7dzPLlx Aul2UQoo/bT8S2Ah/8sbrBK9slrYkZpNT7r7IpqhZT9iYmWo+cD5+erNUcmkLo89bf z3U/9rw8LX8rJWFPWegWWJD3eYxSxIf74rWSBKzg= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727914AbgIUQYN (ORCPT ); Mon, 21 Sep 2020 12:24:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:50966 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726810AbgIUQYM (ORCPT ); Mon, 21 Sep 2020 12:24:12 -0400 Received: from localhost.localdomain (unknown [194.230.155.191]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 67DAE22574; Mon, 21 Sep 2020 16:24:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705451; bh=k7zLMCQ9i2/JBhUqe/oTadHZU3FhlPAS2kI1B02f/EI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LQYRXmLAQd7PJwOEEI2XROzbvWO9G5AE8Kg19nhsgMtXEzh4Ys7CCT0Cu6kF4htuY F1uIBgCTAjNqunx6KpXoUK2EduuN9wikzsoUsMFvdEX+2gnXiweETL9Kvb6IRUTDBW 0ySOlXclKcYzDA++efAYcIrTUpcDQPBZZvcrDqh0= From: Krzysztof Kozlowski To: Pavel Machek , Sakari Ailus , Mauro Carvalho Chehab , Lars-Peter Clausen , Tianshu Qiu , Dongchun Zhu , Shawn Tu , Ricardo Ribalda , Dave Stevenson , Manivannan Sadhasivam , Bingbu Cao , Rui Miguel Silva , Shunqian Zheng , Chiranjeevi Rapolu , Hyungwoo Yang , Wenyou Yang , Hans Verkuil , Marco Felsch , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Krzysztof Kozlowski Subject: [PATCH 03/25] media: i2c: imx290: simplify getting state container Date: Mon, 21 Sep 2020 18:23:20 +0200 Message-Id: <20200921162342.7348-3-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200921162342.7348-1-krzk@kernel.org> References: <20200921162342.7348-1-krzk@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The pointer to 'struct v4l2_subdev' is stored in drvdata via v4l2_i2c_subdev_init() so there is no point of a dance like: struct i2c_client *client = to_i2c_client(struct device *dev) struct v4l2_subdev *sd = i2c_get_clientdata(client); This allows to remove local variable 'client' and few pointer dereferences. White at it, use 'dev' directly instead of 'imx290->dev'. Signed-off-by: Krzysztof Kozlowski --- drivers/media/i2c/imx290.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/media/i2c/imx290.c b/drivers/media/i2c/imx290.c index adcddf3204f7..6319a42057d2 100644 --- a/drivers/media/i2c/imx290.c +++ b/drivers/media/i2c/imx290.c @@ -842,20 +842,19 @@ static int imx290_set_data_lanes(struct imx290 *imx290) static int imx290_power_on(struct device *dev) { - struct i2c_client *client = to_i2c_client(dev); - struct v4l2_subdev *sd = i2c_get_clientdata(client); + struct v4l2_subdev *sd = dev_get_drvdata(dev); struct imx290 *imx290 = to_imx290(sd); int ret; ret = clk_prepare_enable(imx290->xclk); if (ret) { - dev_err(imx290->dev, "Failed to enable clock\n"); + dev_err(dev, "Failed to enable clock\n"); return ret; } ret = regulator_bulk_enable(IMX290_NUM_SUPPLIES, imx290->supplies); if (ret) { - dev_err(imx290->dev, "Failed to enable regulators\n"); + dev_err(dev, "Failed to enable regulators\n"); clk_disable_unprepare(imx290->xclk); return ret; } @@ -872,8 +871,7 @@ static int imx290_power_on(struct device *dev) static int imx290_power_off(struct device *dev) { - struct i2c_client *client = to_i2c_client(dev); - struct v4l2_subdev *sd = i2c_get_clientdata(client); + struct v4l2_subdev *sd = dev_get_drvdata(dev); struct imx290 *imx290 = to_imx290(sd); clk_disable_unprepare(imx290->xclk); From patchwork Mon Sep 21 16:23:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 255694 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 96BCCC43468 for ; Mon, 21 Sep 2020 16:24:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4D0AC22B2D for ; Mon, 21 Sep 2020 16:24:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705476; bh=6HHVhDkjrM3wVW+4jlEI6dRJPDO0oJggIEbA03wBmL0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=KdFRU59a4Lv1aWDhRHDZpZWB+3aHttpJg+GZX7BkfAIoo1qOdok3K2oo7K3OWWgLZ hi4AP1z5RM+2XjaMkRUR5WORA/+wlf4wzCXEePFFh2gR5nwCyzHGon7lchCn3BSGqT ExDnOM16N8K6HRU/2JuOADGPba4l/XASksuyw/bA= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728300AbgIUQYc (ORCPT ); Mon, 21 Sep 2020 12:24:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:51310 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728282AbgIUQYb (ORCPT ); Mon, 21 Sep 2020 12:24:31 -0400 Received: from localhost.localdomain (unknown [194.230.155.191]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8509B2073A; Mon, 21 Sep 2020 16:24:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705471; bh=6HHVhDkjrM3wVW+4jlEI6dRJPDO0oJggIEbA03wBmL0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yP30CiWdXhiAOEWibaerhVKk0N2ePDxvjLTVg+qX6cLXzLmdIW0lUqTvfH8YDbtNp F1g+RP/FewG67tQQ72veLJ55mNZdvetsI5jeSYCe9h7P+hbw2mW4t0s+hvWM/FC/13 hwRTBQhlw8N/ruMYWKSGpAN6cBudu7xe/CjFpwSY= From: Krzysztof Kozlowski To: Pavel Machek , Sakari Ailus , Mauro Carvalho Chehab , Lars-Peter Clausen , Tianshu Qiu , Dongchun Zhu , Shawn Tu , Ricardo Ribalda , Dave Stevenson , Manivannan Sadhasivam , Bingbu Cao , Rui Miguel Silva , Shunqian Zheng , Chiranjeevi Rapolu , Hyungwoo Yang , Wenyou Yang , Hans Verkuil , Marco Felsch , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Krzysztof Kozlowski Subject: [PATCH 05/25] media: i2c: imx319: silence unused acpi_device_id warning Date: Mon, 21 Sep 2020 18:23:22 +0200 Message-Id: <20200921162342.7348-5-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200921162342.7348-1-krzk@kernel.org> References: <20200921162342.7348-1-krzk@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org If driver is built without ACPI, the struct acpi_device_id won't be used: drivers/media/i2c/imx319.c:2536:36: warning: 'imx319_acpi_ids' defined but not used [-Wunused-const-variable=] Signed-off-by: Krzysztof Kozlowski --- drivers/media/i2c/imx319.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/i2c/imx319.c b/drivers/media/i2c/imx319.c index 8b86fc65364e..8473c0bbb35d 100644 --- a/drivers/media/i2c/imx319.c +++ b/drivers/media/i2c/imx319.c @@ -2533,7 +2533,7 @@ static const struct dev_pm_ops imx319_pm_ops = { SET_SYSTEM_SLEEP_PM_OPS(imx319_suspend, imx319_resume) }; -static const struct acpi_device_id imx319_acpi_ids[] = { +static const struct acpi_device_id imx319_acpi_ids[] __maybe_unused = { { "SONY319A" }, { /* sentinel */ } }; From patchwork Mon Sep 21 16:23:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 255693 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C1465C43468 for ; Mon, 21 Sep 2020 16:24:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8E65723119 for ; Mon, 21 Sep 2020 16:24:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705489; bh=ktQpm1/c6hMxf+7bSnCZAwdBXVtxcU32rqZ4E3N6TuA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=tDtkuLLPVgK5mzIClF43b1Q1+L2S0FqIoYfGjSfagBL1KvbTPZrh24w4ptdq1B8Lx aQnB52mL/RLQd+8hovjva9B2lrc0jSX1PKDUXnzt8jtM/u4s4PpaQ/0iu2U3SRiRL/ hzb56IUdAXLaUev6/Edy40zm02pT3s3l595XsWiQ= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727885AbgIUQYq (ORCPT ); Mon, 21 Sep 2020 12:24:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:51554 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726457AbgIUQYp (ORCPT ); Mon, 21 Sep 2020 12:24:45 -0400 Received: from localhost.localdomain (unknown [194.230.155.191]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B1163235F8; Mon, 21 Sep 2020 16:24:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705485; bh=ktQpm1/c6hMxf+7bSnCZAwdBXVtxcU32rqZ4E3N6TuA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BPb8zz/UJm4zKdYR5mtgPRtcigIP8zJszpkVA2TkLpUMFQtVDn0DHobBJd+byXYD3 KddxT1gLTQ71tUo1bPkc1yOPvQX+ExmVzpO6capjRoWHNLbvuSqvHYP4+7RKHTl10e ZCokIdhd0gEzVZsIw+IOR9pdIpXff46KwjN0fyF4= From: Krzysztof Kozlowski To: Pavel Machek , Sakari Ailus , Mauro Carvalho Chehab , Lars-Peter Clausen , Tianshu Qiu , Dongchun Zhu , Shawn Tu , Ricardo Ribalda , Dave Stevenson , Manivannan Sadhasivam , Bingbu Cao , Rui Miguel Silva , Shunqian Zheng , Chiranjeevi Rapolu , Hyungwoo Yang , Wenyou Yang , Hans Verkuil , Marco Felsch , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Krzysztof Kozlowski Subject: [PATCH 07/25] media: i2c: imx355: silence unused acpi_device_id warning Date: Mon, 21 Sep 2020 18:23:24 +0200 Message-Id: <20200921162342.7348-7-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200921162342.7348-1-krzk@kernel.org> References: <20200921162342.7348-1-krzk@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org If driver is built without ACPI, the struct acpi_device_id won't be used: drivers/media/i2c/imx355.c:1836:36: warning: 'imx355_acpi_ids' defined but not used [-Wunused-const-variable=] Signed-off-by: Krzysztof Kozlowski --- drivers/media/i2c/imx355.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/i2c/imx355.c b/drivers/media/i2c/imx355.c index 51245e71b411..8db287251f49 100644 --- a/drivers/media/i2c/imx355.c +++ b/drivers/media/i2c/imx355.c @@ -1833,7 +1833,7 @@ static const struct dev_pm_ops imx355_pm_ops = { SET_SYSTEM_SLEEP_PM_OPS(imx355_suspend, imx355_resume) }; -static const struct acpi_device_id imx355_acpi_ids[] = { +static const struct acpi_device_id imx355_acpi_ids[]__maybe_unused = { { "SONY355A" }, { /* sentinel */ } }; From patchwork Mon Sep 21 16:23:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 255692 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3D953C43468 for ; Mon, 21 Sep 2020 16:25:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EAC0323600 for ; Mon, 21 Sep 2020 16:25:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705503; bh=ze2KJr7NE45YfR5dV1qo2bp2OP4GFrtsjIyNdSy2p0U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=prbVvwK9ffHyqVznr5UzVN0CszdG909p8mjf0HBwFNQGMDLg4lMf7nusKiX922aEN Cs4E79bJvj+6Z9njc+pmxG3I6B2Tvaf3jEx60vOy0h3+RvVCGGP2bhZLEA/WBYlA2A 6ympXlXbVxBAgsrTNVLcaWcaYyjgZJVJr8VZ/Ibw= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728353AbgIUQZC (ORCPT ); Mon, 21 Sep 2020 12:25:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:51822 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728346AbgIUQZB (ORCPT ); Mon, 21 Sep 2020 12:25:01 -0400 Received: from localhost.localdomain (unknown [194.230.155.191]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5145522B2D; Mon, 21 Sep 2020 16:24:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705500; bh=ze2KJr7NE45YfR5dV1qo2bp2OP4GFrtsjIyNdSy2p0U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XNqUNiNBUWo2QcJ1Wc6qPzIQgj2Bpgu+phESZIJtpvztIX/tWY7hw+oEfBDxf7wUM iXfCrVzsxH1esi/ddjmmDcZs2b2/WfHbtzZZbS2umE7UzMseEFLA4SzIYJ5x5y+KVp k9nb/IRbNJXiEsyJEoMYZqcKiXXi71saRLztqPj0= From: Krzysztof Kozlowski To: Pavel Machek , Sakari Ailus , Mauro Carvalho Chehab , Lars-Peter Clausen , Tianshu Qiu , Dongchun Zhu , Shawn Tu , Ricardo Ribalda , Dave Stevenson , Manivannan Sadhasivam , Bingbu Cao , Rui Miguel Silva , Shunqian Zheng , Chiranjeevi Rapolu , Hyungwoo Yang , Wenyou Yang , Hans Verkuil , Marco Felsch , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Krzysztof Kozlowski Subject: [PATCH 09/25] media: i2c: adp1653: simplify getting state container Date: Mon, 21 Sep 2020 18:23:26 +0200 Message-Id: <20200921162342.7348-9-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200921162342.7348-1-krzk@kernel.org> References: <20200921162342.7348-1-krzk@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The pointer to 'struct v4l2_subdev' is stored in drvdata via v4l2_i2c_subdev_init() so there is no point of a dance like: struct i2c_client *client = to_i2c_client(struct device *dev) struct v4l2_subdev *sd = i2c_get_clientdata(client); This allows to remove local variable 'client' and few pointer dereferences. Signed-off-by: Krzysztof Kozlowski --- drivers/media/i2c/adp1653.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/i2c/adp1653.c b/drivers/media/i2c/adp1653.c index 694125a59f64..522a0b10e415 100644 --- a/drivers/media/i2c/adp1653.c +++ b/drivers/media/i2c/adp1653.c @@ -379,8 +379,7 @@ static const struct v4l2_subdev_internal_ops adp1653_internal_ops = { static int adp1653_suspend(struct device *dev) { - struct i2c_client *client = to_i2c_client(dev); - struct v4l2_subdev *subdev = i2c_get_clientdata(client); + struct v4l2_subdev *subdev = dev_get_drvdata(dev); struct adp1653_flash *flash = to_adp1653_flash(subdev); if (!flash->power_count) @@ -391,8 +390,7 @@ static int adp1653_suspend(struct device *dev) static int adp1653_resume(struct device *dev) { - struct i2c_client *client = to_i2c_client(dev); - struct v4l2_subdev *subdev = i2c_get_clientdata(client); + struct v4l2_subdev *subdev = dev_get_drvdata(dev); struct adp1653_flash *flash = to_adp1653_flash(subdev); if (!flash->power_count) From patchwork Mon Sep 21 16:23:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 255691 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 584E7C43466 for ; Mon, 21 Sep 2020 16:25:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 022D6235FD for ; Mon, 21 Sep 2020 16:25:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705523; bh=CHLC75BCi9/WDkWDRXI8ZQwNHC7vWtrWv1SpzAx+qss=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=PnDqZirVnUgTHI/1GinUeFx9oTXeSJxsA+AEBtvpm3lAKmc6hK1Z0BHR0l7U2/SyM OMn6/4XpoowDietxpF4OUFDrKAkCBBWBrKS+KTWToPcIxs0PCFl2kwv7+DnkhD19OW 0tyGvY7+td6acGiWrFUhdCChdK/SQPM+gdzHjHuM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728386AbgIUQZV (ORCPT ); Mon, 21 Sep 2020 12:25:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:52152 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728196AbgIUQZS (ORCPT ); Mon, 21 Sep 2020 12:25:18 -0400 Received: from localhost.localdomain (unknown [194.230.155.191]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 71873235FA; Mon, 21 Sep 2020 16:25:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705517; bh=CHLC75BCi9/WDkWDRXI8ZQwNHC7vWtrWv1SpzAx+qss=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZzB6MxuixlbtU1WFKqFk8X/YvExTPEGKwKGEk0GimD6+tZ9vvw7DSxAksh1CjFCE5 d42InYQ+4mq588RhREDUdagJQh3KyAwT3q9sG+w600IkpiZPG11uYPtIhCrpMqGDNr Hclz5Xa8xD70zi25c5PRdRYHGI+X2eLVJgmQCquk= From: Krzysztof Kozlowski To: Pavel Machek , Sakari Ailus , Mauro Carvalho Chehab , Lars-Peter Clausen , Tianshu Qiu , Dongchun Zhu , Shawn Tu , Ricardo Ribalda , Dave Stevenson , Manivannan Sadhasivam , Bingbu Cao , Rui Miguel Silva , Shunqian Zheng , Chiranjeevi Rapolu , Hyungwoo Yang , Wenyou Yang , Hans Verkuil , Marco Felsch , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Krzysztof Kozlowski Subject: [PATCH 11/25] media: i2c: ak7375: simplify getting state container Date: Mon, 21 Sep 2020 18:23:28 +0200 Message-Id: <20200921162342.7348-11-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200921162342.7348-1-krzk@kernel.org> References: <20200921162342.7348-1-krzk@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The pointer to 'struct v4l2_subdev' is stored in drvdata via v4l2_i2c_subdev_init() so there is no point of a dance like: struct i2c_client *client = to_i2c_client(struct device *dev) struct v4l2_subdev *sd = i2c_get_clientdata(client); This allows to remove local variable 'client' and few pointer dereferences. Signed-off-by: Krzysztof Kozlowski --- drivers/media/i2c/ak7375.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/media/i2c/ak7375.c b/drivers/media/i2c/ak7375.c index 7b14b11605ca..e1f94ee0f48f 100644 --- a/drivers/media/i2c/ak7375.c +++ b/drivers/media/i2c/ak7375.c @@ -196,9 +196,7 @@ static int ak7375_remove(struct i2c_client *client) */ static int __maybe_unused ak7375_vcm_suspend(struct device *dev) { - - struct i2c_client *client = to_i2c_client(dev); - struct v4l2_subdev *sd = i2c_get_clientdata(client); + struct v4l2_subdev *sd = dev_get_drvdata(dev); struct ak7375_device *ak7375_dev = sd_to_ak7375_vcm(sd); int ret, val; @@ -233,8 +231,7 @@ static int __maybe_unused ak7375_vcm_suspend(struct device *dev) */ static int __maybe_unused ak7375_vcm_resume(struct device *dev) { - struct i2c_client *client = to_i2c_client(dev); - struct v4l2_subdev *sd = i2c_get_clientdata(client); + struct v4l2_subdev *sd = dev_get_drvdata(dev); struct ak7375_device *ak7375_dev = sd_to_ak7375_vcm(sd); int ret, val; From patchwork Mon Sep 21 16:23:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 255690 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A8FE6C43468 for ; Mon, 21 Sep 2020 16:25:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 53E8723787 for ; Mon, 21 Sep 2020 16:25:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705538; bh=SMa0X6wLFi0OXfbSfTM4oDL8yzm+QV3I3xV5NwDCDzQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=J7UlxHPC/bkASZ4zqRwfVHynB8OuDvum2IFsuDyawR/szLffKSMil9ty143aTHjQL 0KkZyqKBmTI/PRlZi596uDBfRtUFSgWk2hlNl4OfhiSp+MqRuzT/wNN1YgY2660/Ou g4aDxuI1yF39sFbsiL4tCUHVshOYEAd2TzHl0Q9o= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728202AbgIUQZe (ORCPT ); Mon, 21 Sep 2020 12:25:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:52448 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726795AbgIUQZe (ORCPT ); Mon, 21 Sep 2020 12:25:34 -0400 Received: from localhost.localdomain (unknown [194.230.155.191]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4A72323718; Mon, 21 Sep 2020 16:25:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705533; bh=SMa0X6wLFi0OXfbSfTM4oDL8yzm+QV3I3xV5NwDCDzQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=I5qsj7rMWW6k/AR1nmriqzvNit053iQlwmV05moQ+Sr1WvhzwA3sAGqhcNjodbmtP QGPcmv6BBypIndEfojhNATOFSdYIT1GwXZC2PtBZ7xvCUowTbr2SX9+z2BdMB3U1dm YJoIbqaOOlqJGPrQ/9Rqp/DuiEFOlRaat6Ifk1FM= From: Krzysztof Kozlowski To: Pavel Machek , Sakari Ailus , Mauro Carvalho Chehab , Lars-Peter Clausen , Tianshu Qiu , Dongchun Zhu , Shawn Tu , Ricardo Ribalda , Dave Stevenson , Manivannan Sadhasivam , Bingbu Cao , Rui Miguel Silva , Shunqian Zheng , Chiranjeevi Rapolu , Hyungwoo Yang , Wenyou Yang , Hans Verkuil , Marco Felsch , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Krzysztof Kozlowski Subject: [PATCH 13/25] media: i2c: et8ek8: simplify getting state container Date: Mon, 21 Sep 2020 18:23:30 +0200 Message-Id: <20200921162342.7348-13-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200921162342.7348-1-krzk@kernel.org> References: <20200921162342.7348-1-krzk@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The pointer to 'struct v4l2_subdev' is stored in drvdata via v4l2_i2c_subdev_init() so there is no point of a dance like: struct i2c_client *client = to_i2c_client(struct device *dev) struct v4l2_subdev *sd = i2c_get_clientdata(client); This allows to remove local variable 'client' and few pointer dereferences. Signed-off-by: Krzysztof Kozlowski --- drivers/media/i2c/et8ek8/et8ek8_driver.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/media/i2c/et8ek8/et8ek8_driver.c b/drivers/media/i2c/et8ek8/et8ek8_driver.c index 256acf73d5ea..122af761c8e3 100644 --- a/drivers/media/i2c/et8ek8/et8ek8_driver.c +++ b/drivers/media/i2c/et8ek8/et8ek8_driver.c @@ -1237,7 +1237,7 @@ static ssize_t et8ek8_priv_mem_read(struct device *dev, struct device_attribute *attr, char *buf) { - struct v4l2_subdev *subdev = i2c_get_clientdata(to_i2c_client(dev)); + struct v4l2_subdev *subdev = dev_get_drvdata(dev); struct et8ek8_sensor *sensor = to_et8ek8_sensor(subdev); #if PAGE_SIZE < ET8EK8_PRIV_MEM_SIZE @@ -1374,8 +1374,7 @@ static const struct v4l2_subdev_internal_ops et8ek8_internal_ops = { */ static int __maybe_unused et8ek8_suspend(struct device *dev) { - struct i2c_client *client = to_i2c_client(dev); - struct v4l2_subdev *subdev = i2c_get_clientdata(client); + struct v4l2_subdev *subdev = dev_get_drvdata(dev); struct et8ek8_sensor *sensor = to_et8ek8_sensor(subdev); if (!sensor->power_count) @@ -1386,8 +1385,7 @@ static int __maybe_unused et8ek8_suspend(struct device *dev) static int __maybe_unused et8ek8_resume(struct device *dev) { - struct i2c_client *client = to_i2c_client(dev); - struct v4l2_subdev *subdev = i2c_get_clientdata(client); + struct v4l2_subdev *subdev = dev_get_drvdata(dev); struct et8ek8_sensor *sensor = to_et8ek8_sensor(subdev); if (!sensor->power_count) From patchwork Mon Sep 21 16:23:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 255689 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 01225C43468 for ; Mon, 21 Sep 2020 16:25:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9E72423788 for ; Mon, 21 Sep 2020 16:25:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705555; bh=ajwhrBx79U+bT1q4Hq0mOafWCuBTUSIdazoJyBU73+w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=CIDuPrY2stpU2ji5HsTdIusCpcDrqJ3OWwRuryv0ZQvfUxXYdWcMJYB/7gJ0MLPge oh8KEEszpzb2JlV7Zk3xT6uUYzNmLA8FPKK+XWArrNt0ZDCyEXqRkRKhJG5THiRarU ygBrv9LujVulX/RM9gktR8MEbVa/G1ziDVN4/Sz0= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728415AbgIUQZv (ORCPT ); Mon, 21 Sep 2020 12:25:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:52650 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728041AbgIUQZv (ORCPT ); Mon, 21 Sep 2020 12:25:51 -0400 Received: from localhost.localdomain (unknown [194.230.155.191]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4632D23787; Mon, 21 Sep 2020 16:25:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705550; bh=ajwhrBx79U+bT1q4Hq0mOafWCuBTUSIdazoJyBU73+w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fiLdN+1jpgu4zzM2DLOyvmGwkIDdnOlqudbapOvWAcTBfd11PE+mZup4KvTbmkR3W byHmpKA8Wc183q5WsWCx69jW/x37OvYCRt3iodIt/IHemFCK14+Cbv4Pp+sI3iB1j/ DQ0Vik4XvOcz9oQjNJ/N3nH8zxsWQ/76gxGzDxtE= From: Krzysztof Kozlowski To: Pavel Machek , Sakari Ailus , Mauro Carvalho Chehab , Lars-Peter Clausen , Tianshu Qiu , Dongchun Zhu , Shawn Tu , Ricardo Ribalda , Dave Stevenson , Manivannan Sadhasivam , Bingbu Cao , Rui Miguel Silva , Shunqian Zheng , Chiranjeevi Rapolu , Hyungwoo Yang , Wenyou Yang , Hans Verkuil , Marco Felsch , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Krzysztof Kozlowski Subject: [PATCH 15/25] media: i2c: ov13858: simplify getting state container Date: Mon, 21 Sep 2020 18:23:32 +0200 Message-Id: <20200921162342.7348-15-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200921162342.7348-1-krzk@kernel.org> References: <20200921162342.7348-1-krzk@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The pointer to 'struct v4l2_subdev' is stored in drvdata via v4l2_i2c_subdev_init() so there is no point of a dance like: struct i2c_client *client = to_i2c_client(struct device *dev) struct v4l2_subdev *sd = i2c_get_clientdata(client); This allows to remove local variable 'client' and few pointer dereferences. Signed-off-by: Krzysztof Kozlowski --- drivers/media/i2c/ov13858.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/i2c/ov13858.c b/drivers/media/i2c/ov13858.c index 236ad2c816b7..2f3be7a80cef 100644 --- a/drivers/media/i2c/ov13858.c +++ b/drivers/media/i2c/ov13858.c @@ -1505,8 +1505,7 @@ static int ov13858_set_stream(struct v4l2_subdev *sd, int enable) static int __maybe_unused ov13858_suspend(struct device *dev) { - struct i2c_client *client = to_i2c_client(dev); - struct v4l2_subdev *sd = i2c_get_clientdata(client); + struct v4l2_subdev *sd = dev_get_drvdata(dev); struct ov13858 *ov13858 = to_ov13858(sd); if (ov13858->streaming) @@ -1517,8 +1516,7 @@ static int __maybe_unused ov13858_suspend(struct device *dev) static int __maybe_unused ov13858_resume(struct device *dev) { - struct i2c_client *client = to_i2c_client(dev); - struct v4l2_subdev *sd = i2c_get_clientdata(client); + struct v4l2_subdev *sd = dev_get_drvdata(dev); struct ov13858 *ov13858 = to_ov13858(sd); int ret; From patchwork Mon Sep 21 16:23:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 255688 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 00969C43465 for ; Mon, 21 Sep 2020 16:26:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B240C2389E for ; Mon, 21 Sep 2020 16:26:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705581; bh=GTz5+/t8rTLyiqlN4cq3qgb4k1L5oyAC8CXlM0q9SZE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=dR2Y5GhpldPzRuZ2JPqq6hQGank4WfYWqyfUzi+LKpPXR4Pm4Ol0mxiS609RgibGP MZvlrwJrg50SvaoQ/kfj0zNxfD6XD+XZ9fvH4OsmKw8oVYTeQlAhVox9DHX5RB0Qx+ pjLWY/vUqVaYPSg7TJxDrYf+cGmQHwqzSxGIdx7k= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728052AbgIUQ0S (ORCPT ); Mon, 21 Sep 2020 12:26:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:52908 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726795AbgIUQ0S (ORCPT ); Mon, 21 Sep 2020 12:26:18 -0400 Received: from localhost.localdomain (unknown [194.230.155.191]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C97F323788; Mon, 21 Sep 2020 16:26:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705577; bh=GTz5+/t8rTLyiqlN4cq3qgb4k1L5oyAC8CXlM0q9SZE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KnJwc9xynfAsa+31SqcJp++tz51IZo0V6fFEl+eQlAsNLaC4aNldRtI1Zs5t0pK4J eeLR93RhBSUZv9Zz/gysh94qd88GF21R5wL5vZ7mMSAnA6n4oAg4rSipBsCusrMkLd QTuXY7wTMD8ABd4vRjJ/32iottBRmpFEhGie92ZE= From: Krzysztof Kozlowski To: Pavel Machek , Sakari Ailus , Mauro Carvalho Chehab , Lars-Peter Clausen , Tianshu Qiu , Dongchun Zhu , Shawn Tu , Ricardo Ribalda , Dave Stevenson , Manivannan Sadhasivam , Bingbu Cao , Rui Miguel Silva , Shunqian Zheng , Chiranjeevi Rapolu , Hyungwoo Yang , Wenyou Yang , Hans Verkuil , Marco Felsch , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Krzysztof Kozlowski Subject: [PATCH 17/25] media: i2c: ov2685: simplify getting state container Date: Mon, 21 Sep 2020 18:23:34 +0200 Message-Id: <20200921162342.7348-17-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200921162342.7348-1-krzk@kernel.org> References: <20200921162342.7348-1-krzk@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The pointer to 'struct v4l2_subdev' is stored in drvdata via v4l2_i2c_subdev_init() so there is no point of a dance like: struct i2c_client *client = to_i2c_client(struct device *dev) struct v4l2_subdev *sd = i2c_get_clientdata(client); This allows to remove local variable 'client' and few pointer dereferences. Signed-off-by: Krzysztof Kozlowski --- drivers/media/i2c/ov2685.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/i2c/ov2685.c b/drivers/media/i2c/ov2685.c index 6814583d9606..49a2dcedb347 100644 --- a/drivers/media/i2c/ov2685.c +++ b/drivers/media/i2c/ov2685.c @@ -506,8 +506,7 @@ static int ov2685_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh) static int __maybe_unused ov2685_runtime_resume(struct device *dev) { - struct i2c_client *client = to_i2c_client(dev); - struct v4l2_subdev *sd = i2c_get_clientdata(client); + struct v4l2_subdev *sd = dev_get_drvdata(dev); struct ov2685 *ov2685 = to_ov2685(sd); return __ov2685_power_on(ov2685); @@ -515,8 +514,7 @@ static int __maybe_unused ov2685_runtime_resume(struct device *dev) static int __maybe_unused ov2685_runtime_suspend(struct device *dev) { - struct i2c_client *client = to_i2c_client(dev); - struct v4l2_subdev *sd = i2c_get_clientdata(client); + struct v4l2_subdev *sd = dev_get_drvdata(dev); struct ov2685 *ov2685 = to_ov2685(sd); __ov2685_power_off(ov2685); From patchwork Mon Sep 21 16:23:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 255687 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3552FC43466 for ; Mon, 21 Sep 2020 16:26:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 03683238E2 for ; Mon, 21 Sep 2020 16:26:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705598; bh=8mnrw8vcPI3JMN8evy2QkG/hMKKVSLWHoPB9QX3PfK0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=ZiAtnVJTaEt99KcL9Z8d6w5spWZHP80O2FyKowIMokjD0C9sgJysSCpxG1d/Pz2Eb 3fbIYjdNYg0rzMbI9HfKbiJAYVdr7q7tL9VjyQbdxdTId0SlRvgeQnv3RsM89mSXUN TGE5NRN0O/rBYg4Psf8VEES3oxNl+JlQg7v5OHWY= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728026AbgIUQ0e (ORCPT ); Mon, 21 Sep 2020 12:26:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:53108 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726795AbgIUQ0e (ORCPT ); Mon, 21 Sep 2020 12:26:34 -0400 Received: from localhost.localdomain (unknown [194.230.155.191]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3269E2388E; Mon, 21 Sep 2020 16:26:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705593; bh=8mnrw8vcPI3JMN8evy2QkG/hMKKVSLWHoPB9QX3PfK0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xEBS3/YCJ8PWTNz/u0z/87ZrL+HMtVAvjLoj36CvzsuMXkptHlWhWteiPuURpx0Vv eqMNTybTzyfZr5rJjJ9OiLitzAkb3ffhAoS7MKkTx13DhrY4weyWKEI2EIxztLI6D2 FwX1yULG45R95Gpnf9wl8fa6aE874U3WXYBmGn/s= From: Krzysztof Kozlowski To: Pavel Machek , Sakari Ailus , Mauro Carvalho Chehab , Lars-Peter Clausen , Tianshu Qiu , Dongchun Zhu , Shawn Tu , Ricardo Ribalda , Dave Stevenson , Manivannan Sadhasivam , Bingbu Cao , Rui Miguel Silva , Shunqian Zheng , Chiranjeevi Rapolu , Hyungwoo Yang , Wenyou Yang , Hans Verkuil , Marco Felsch , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Krzysztof Kozlowski Subject: [PATCH 19/25] media: i2c: ov5670: simplify getting state container Date: Mon, 21 Sep 2020 18:23:36 +0200 Message-Id: <20200921162342.7348-19-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200921162342.7348-1-krzk@kernel.org> References: <20200921162342.7348-1-krzk@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The pointer to 'struct v4l2_subdev' is stored in drvdata via v4l2_i2c_subdev_init() so there is no point of a dance like: struct i2c_client *client = to_i2c_client(struct device *dev) struct v4l2_subdev *sd = i2c_get_clientdata(client); This allows to remove local variable 'client' and few pointer dereferences. Signed-off-by: Krzysztof Kozlowski --- drivers/media/i2c/ov5670.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/i2c/ov5670.c b/drivers/media/i2c/ov5670.c index f26252e35e08..148fd4e05029 100644 --- a/drivers/media/i2c/ov5670.c +++ b/drivers/media/i2c/ov5670.c @@ -2373,8 +2373,7 @@ static int ov5670_set_stream(struct v4l2_subdev *sd, int enable) static int __maybe_unused ov5670_suspend(struct device *dev) { - struct i2c_client *client = to_i2c_client(dev); - struct v4l2_subdev *sd = i2c_get_clientdata(client); + struct v4l2_subdev *sd = dev_get_drvdata(dev); struct ov5670 *ov5670 = to_ov5670(sd); if (ov5670->streaming) @@ -2385,8 +2384,7 @@ static int __maybe_unused ov5670_suspend(struct device *dev) static int __maybe_unused ov5670_resume(struct device *dev) { - struct i2c_client *client = to_i2c_client(dev); - struct v4l2_subdev *sd = i2c_get_clientdata(client); + struct v4l2_subdev *sd = dev_get_drvdata(dev); struct ov5670 *ov5670 = to_ov5670(sd); int ret; From patchwork Mon Sep 21 16:23:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 255686 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C2B35C43465 for ; Mon, 21 Sep 2020 16:26:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 81D99238EE for ; Mon, 21 Sep 2020 16:26:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705613; bh=se6/uKPPpKEW01tuRCD4MWEIWWgItjLyAEr9HbG31rY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=RDYNM08uUrFp3boQwJ+x6AlwA4sJqj+p40VvuHPJuvl4XUNu7U+7rjsx4FOt5Ibp3 tc4YTKsOZnS1bFrFqoWTXX6zwHgMdTzK3Ug4C4yQyti5Y4CF9EXiQHEgKVtmHPO8Dy pZyKY/zPVKAWhQI80pVB23wVKB1WqLViHwIQElZQ= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728449AbgIUQ0u (ORCPT ); Mon, 21 Sep 2020 12:26:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:53370 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726795AbgIUQ0t (ORCPT ); Mon, 21 Sep 2020 12:26:49 -0400 Received: from localhost.localdomain (unknown [194.230.155.191]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D873F238D7; Mon, 21 Sep 2020 16:26:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705609; bh=se6/uKPPpKEW01tuRCD4MWEIWWgItjLyAEr9HbG31rY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yztFnIYuW2Y+/vTcqRlehF+7CHwU3o45YmIChLNuWAllDw8QXGcoUWMWOLyc5tna4 FGmHBihGI7ipXHriYYFs9oQKtTEhgGqfMbaD5AUoXnCDVfL4SGBfgCPy8g1DzDiiHu 8m4IBk7c5MzukySsPoY4R8I239XmR/yz2osJnn24= From: Krzysztof Kozlowski To: Pavel Machek , Sakari Ailus , Mauro Carvalho Chehab , Lars-Peter Clausen , Tianshu Qiu , Dongchun Zhu , Shawn Tu , Ricardo Ribalda , Dave Stevenson , Manivannan Sadhasivam , Bingbu Cao , Rui Miguel Silva , Shunqian Zheng , Chiranjeevi Rapolu , Hyungwoo Yang , Wenyou Yang , Hans Verkuil , Marco Felsch , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Krzysztof Kozlowski Subject: [PATCH 21/25] media: i2c: ov5695: simplify getting state container Date: Mon, 21 Sep 2020 18:23:38 +0200 Message-Id: <20200921162342.7348-21-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200921162342.7348-1-krzk@kernel.org> References: <20200921162342.7348-1-krzk@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The pointer to 'struct v4l2_subdev' is stored in drvdata via v4l2_i2c_subdev_init() so there is no point of a dance like: struct i2c_client *client = to_i2c_client(struct device *dev) struct v4l2_subdev *sd = i2c_get_clientdata(client); This allows to remove local variable 'client' and few pointer dereferences. Signed-off-by: Krzysztof Kozlowski --- drivers/media/i2c/ov5695.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/i2c/ov5695.c b/drivers/media/i2c/ov5695.c index cc678d9d2e0d..bbccb6f9582f 100644 --- a/drivers/media/i2c/ov5695.c +++ b/drivers/media/i2c/ov5695.c @@ -1033,8 +1033,7 @@ static void __ov5695_power_off(struct ov5695 *ov5695) static int __maybe_unused ov5695_runtime_resume(struct device *dev) { - struct i2c_client *client = to_i2c_client(dev); - struct v4l2_subdev *sd = i2c_get_clientdata(client); + struct v4l2_subdev *sd = dev_get_drvdata(dev); struct ov5695 *ov5695 = to_ov5695(sd); return __ov5695_power_on(ov5695); @@ -1042,8 +1041,7 @@ static int __maybe_unused ov5695_runtime_resume(struct device *dev) static int __maybe_unused ov5695_runtime_suspend(struct device *dev) { - struct i2c_client *client = to_i2c_client(dev); - struct v4l2_subdev *sd = i2c_get_clientdata(client); + struct v4l2_subdev *sd = dev_get_drvdata(dev); struct ov5695 *ov5695 = to_ov5695(sd); __ov5695_power_off(ov5695); From patchwork Mon Sep 21 16:23:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 255685 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AF230C43466 for ; Mon, 21 Sep 2020 16:27:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 65B9D2396F for ; Mon, 21 Sep 2020 16:27:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705635; bh=kQ1isaRBOCePbNrUXnwUAjwlHdI57v1SBmE8/Th33sY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=qLs5iNWAXXL3p1f84txRzKORe5lHm7YM2ja8KHwUFcH/s1YbaYhXgLaYyQO/QQEc0 7qhAbcy7LxDsylsyYV4OCJaIzSoGmtD6oWL8VsQstHlFF/6hAIK+kIDaDBKoJ81QLE v7VUUGn/uXHY3kXVCKPU+IjMp//Jt3TCT+9yHumo= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728072AbgIUQ1I (ORCPT ); Mon, 21 Sep 2020 12:27:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:53694 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728468AbgIUQ1D (ORCPT ); Mon, 21 Sep 2020 12:27:03 -0400 Received: from localhost.localdomain (unknown [194.230.155.191]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 777532395B; Mon, 21 Sep 2020 16:26:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705623; bh=kQ1isaRBOCePbNrUXnwUAjwlHdI57v1SBmE8/Th33sY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DGPSXr1vvL6+1/YV7KW0k84wH1dx+ESee/yyT/SuxxpY+hYQgv7r68+5HFxMjeCrn M37Urti+deNZZragmJ+0KDlipP+LEwkF9NpgtR0DLpgmA11plSIyLuNg3VW0R3tm6c DNxHVr3CDNp1rZeHM5ELfoHR8wCQLs9R5cH7+yCU= From: Krzysztof Kozlowski To: Pavel Machek , Sakari Ailus , Mauro Carvalho Chehab , Lars-Peter Clausen , Tianshu Qiu , Dongchun Zhu , Shawn Tu , Ricardo Ribalda , Dave Stevenson , Manivannan Sadhasivam , Bingbu Cao , Rui Miguel Silva , Shunqian Zheng , Chiranjeevi Rapolu , Hyungwoo Yang , Wenyou Yang , Hans Verkuil , Marco Felsch , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Krzysztof Kozlowski Subject: [PATCH 23/25] media: i2c: ov8856: simplify getting state container Date: Mon, 21 Sep 2020 18:23:40 +0200 Message-Id: <20200921162342.7348-23-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200921162342.7348-1-krzk@kernel.org> References: <20200921162342.7348-1-krzk@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The pointer to 'struct v4l2_subdev' is stored in drvdata via v4l2_i2c_subdev_init() so there is no point of a dance like: struct i2c_client *client = to_i2c_client(struct device *dev) struct v4l2_subdev *sd = i2c_get_clientdata(client); This allows to remove local variable 'client' and few pointer dereferences. Signed-off-by: Krzysztof Kozlowski --- drivers/media/i2c/ov8856.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/i2c/ov8856.c b/drivers/media/i2c/ov8856.c index 2f4ceaa80593..d8cefd3d4045 100644 --- a/drivers/media/i2c/ov8856.c +++ b/drivers/media/i2c/ov8856.c @@ -1417,8 +1417,7 @@ static void __ov8856_power_off(struct ov8856 *ov8856) static int __maybe_unused ov8856_suspend(struct device *dev) { - struct i2c_client *client = to_i2c_client(dev); - struct v4l2_subdev *sd = i2c_get_clientdata(client); + struct v4l2_subdev *sd = dev_get_drvdata(dev); struct ov8856 *ov8856 = to_ov8856(sd); mutex_lock(&ov8856->mutex); @@ -1433,8 +1432,7 @@ static int __maybe_unused ov8856_suspend(struct device *dev) static int __maybe_unused ov8856_resume(struct device *dev) { - struct i2c_client *client = to_i2c_client(dev); - struct v4l2_subdev *sd = i2c_get_clientdata(client); + struct v4l2_subdev *sd = dev_get_drvdata(dev); struct ov8856 *ov8856 = to_ov8856(sd); int ret; From patchwork Mon Sep 21 16:23:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 255684 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2AA7DC43465 for ; Mon, 21 Sep 2020 16:27:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E320C23976 for ; Mon, 21 Sep 2020 16:27:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705645; bh=e6E2P2BYXwVmCEmpSJPcXJWaHXTpyBF/68bjK1631TY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=U7wEK3i/S8SRqMB4Vy46OTTals5ynAzHX6/Kk8FbPfWt8wSSkFA0t1y2oYERvccR2 b9EkXKRf+5fMFwrIsS8KlmDYKZQCkLikIMV3Zt+PfWUO4sXEikqukDgVuBaT1NJJUE fIFF7YOKNmSyoYcy8EtFTBviQ4OgHYnmzvpHNVfs= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728301AbgIUQ1W (ORCPT ); Mon, 21 Sep 2020 12:27:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:53978 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726430AbgIUQ1T (ORCPT ); Mon, 21 Sep 2020 12:27:19 -0400 Received: from localhost.localdomain (unknown [194.230.155.191]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E68612223E; Mon, 21 Sep 2020 16:27:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705638; bh=e6E2P2BYXwVmCEmpSJPcXJWaHXTpyBF/68bjK1631TY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gqklv8QK+pLEBZnsQ3PyfqEj3QjNrO1ivWXstm8712DqS1gkPnghbR70d2eHpOBvB ksJL7N1syixJxvInW/mZMrOMb1+XWTMuXE4WIh1cCyaxrruGHAuTd0fexNoaolloDh mzvgfbytCWNGmh+HT6C8WwuGQW6J1S+I7UmOnvHU= From: Krzysztof Kozlowski To: Pavel Machek , Sakari Ailus , Mauro Carvalho Chehab , Lars-Peter Clausen , Tianshu Qiu , Dongchun Zhu , Shawn Tu , Ricardo Ribalda , Dave Stevenson , Manivannan Sadhasivam , Bingbu Cao , Rui Miguel Silva , Shunqian Zheng , Chiranjeevi Rapolu , Hyungwoo Yang , Wenyou Yang , Hans Verkuil , Marco Felsch , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Krzysztof Kozlowski Subject: [PATCH 25/25] media: i2c: tvp5150: simplify getting state container Date: Mon, 21 Sep 2020 18:23:42 +0200 Message-Id: <20200921162342.7348-25-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200921162342.7348-1-krzk@kernel.org> References: <20200921162342.7348-1-krzk@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The pointer to 'struct v4l2_subdev' is stored in drvdata via v4l2_i2c_subdev_init() so there is no point of a dance like: struct i2c_client *client = to_i2c_client(struct device *dev) struct v4l2_subdev *sd = i2c_get_clientdata(client); This allows to remove local variable 'client' and few pointer dereferences. Signed-off-by: Krzysztof Kozlowski --- drivers/media/i2c/tvp5150.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/i2c/tvp5150.c b/drivers/media/i2c/tvp5150.c index 7d9401219a3a..29f65bb6103d 100644 --- a/drivers/media/i2c/tvp5150.c +++ b/drivers/media/i2c/tvp5150.c @@ -1413,8 +1413,7 @@ static const struct media_entity_operations tvp5150_sd_media_ops = { ****************************************************************************/ static int __maybe_unused tvp5150_runtime_suspend(struct device *dev) { - struct i2c_client *client = to_i2c_client(dev); - struct v4l2_subdev *sd = i2c_get_clientdata(client); + struct v4l2_subdev *sd = dev_get_drvdata(dev); struct tvp5150 *decoder = to_tvp5150(sd); if (decoder->irq) @@ -1427,8 +1426,7 @@ static int __maybe_unused tvp5150_runtime_suspend(struct device *dev) static int __maybe_unused tvp5150_runtime_resume(struct device *dev) { - struct i2c_client *client = to_i2c_client(dev); - struct v4l2_subdev *sd = i2c_get_clientdata(client); + struct v4l2_subdev *sd = dev_get_drvdata(dev); struct tvp5150 *decoder = to_tvp5150(sd); if (decoder->irq)