From patchwork Thu May 4 17:36:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Reichel X-Patchwork-Id: 13231438 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E5D31C7EE30 for ; Thu, 4 May 2023 17:36:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=jU3w/QzTGenKq8lpRA1+17IBUtHi8eZjH9Od2IpsgrA=; b=DeEGvs9fStljyo JsZ1dJFyvmWmAMUHke6uRXTNaotqXvV117fW4BgcL9fkPbTWQnTM06AdOUvBmmpKbfFlifpvFu3FP J/EBfI/lcckct5/IfOmQC+LYhJjZt1C8uxEA6IlHUmo/rxXL6bPqXFTwmI6/7+gHsmeZ9Z62nVC6o fkgKAOTdT1ww5hc/AqEE/kclU+ibyrJ1vU7FrHqZlS3oBSGAmhouW+3hdbMrt3jWtT5gwcIiTygTC d7VEEkIVqLAjfcKFEUbIbnVlu9u/B3pg0HK2tG0z7VLl+If+ieJzbdg7stA9ZO9Kq9K7u85S6U5bM 4bMpPvY9pElc4avzSLXQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pucsY-008R0S-0W; Thu, 04 May 2023 17:36:30 +0000 Received: from madras.collabora.co.uk ([46.235.227.172]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pucsU-008QxO-2k for linux-rockchip@lists.infradead.org; Thu, 04 May 2023 17:36:28 +0000 Received: from jupiter.universe (dyndsl-091-248-211-176.ewe-ip-backbone.de [91.248.211.176]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: sre) by madras.collabora.co.uk (Postfix) with ESMTPSA id 0421166056FF; Thu, 4 May 2023 18:36:23 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1683221783; bh=Tf74/5z5jqPq6rLNLm/BuBvWZXNjsOipnLMV/fkZY7U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bkGajxdaIy17l1ESnvrbEsNACn4Owuhl3V6b4XHURI7d6VQ8e/t26v1uwKnsvbcGG 5rQmAWfeZt4hqXpIv1Tkkyybis1ZOmN74m3ujavPHpSP7WXfB4sqOFViOl6xz89uCY X099lRICgod273kpWh1unwC78d2L5J8ZDxyCHJ4+/UBnYz8hip66EYn1fhzvDimGjR ET1K+vojMn6mRp+whmyUF7pAU3TeK/hHueo0s77Qbv9Kt1n6xknQcdb+lTlEVoh7up Kgk1q6gpR/3ITj8AxN+iyqBsP5VuiaOliKWpLgiYonanxQWFOUVWdukxc/NonXIcYa oWT7cozvdU9sA== Received: by jupiter.universe (Postfix, from userid 1000) id DB30D4807E3; Thu, 4 May 2023 19:36:20 +0200 (CEST) From: Sebastian Reichel To: Heiko Stuebner , Rob Herring , Krzysztof Kozlowski , Lee Jones Cc: Michael Turquette , Stephen Boyd , Linus Walleij , Mark Brown , Liam Girdwood , Alexandre Belloni , Alessandro Zummo , linux-rockchip@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Sebastian Reichel , kernel@collabora.com, Diederik de Haas , Vincent Legoll Subject: [PATCH v8 04/14] mfd: rk808: replace 'struct i2c_client' with 'struct device' Date: Thu, 4 May 2023 19:36:08 +0200 Message-Id: <20230504173618.142075-5-sebastian.reichel@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230504173618.142075-1-sebastian.reichel@collabora.com> References: <20230504173618.142075-1-sebastian.reichel@collabora.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230504_103627_085146_0EB2185E X-CRM114-Status: GOOD ( 13.81 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org Put 'struct device' pointer into the MFD platform_data instead of the 'struct i2c_client' pointer. This simplifies the code and prepares the MFD for SPI support. Acked-for-MFD-by: Lee Jones Tested-by: Diederik de Haas # Rock64, Quartz64 Model A + B Tested-by: Vincent Legoll # Pine64 QuartzPro64 Signed-off-by: Sebastian Reichel --- drivers/mfd/rk808.c | 6 +++--- include/linux/mfd/rk808.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/mfd/rk808.c b/drivers/mfd/rk808.c index f42e09e3a3f5..ce52307cbaea 100644 --- a/drivers/mfd/rk808.c +++ b/drivers/mfd/rk808.c @@ -577,7 +577,7 @@ static int rk808_power_off(struct sys_off_data *data) } ret = regmap_update_bits(rk808->regmap, reg, bit, bit); if (ret) - dev_err(&rk808->i2c->dev, "Failed to shutdown device!\n"); + dev_err(rk808->dev, "Failed to shutdown device!\n"); return NOTIFY_DONE; } @@ -600,7 +600,7 @@ static int rk808_restart(struct sys_off_data *data) } ret = regmap_update_bits(rk808->regmap, reg, bit, bit); if (ret) - dev_err(&rk808->i2c->dev, "Failed to restart device!\n"); + dev_err(rk808->dev, "Failed to restart device!\n"); return NOTIFY_DONE; } @@ -720,7 +720,7 @@ static int rk808_probe(struct i2c_client *client) return -EINVAL; } - rk808->i2c = client; + rk808->dev = &client->dev; i2c_set_clientdata(client, rk808); rk808->regmap = devm_regmap_init_i2c(client, rk808->regmap_cfg); diff --git a/include/linux/mfd/rk808.h b/include/linux/mfd/rk808.h index 9af1f3105f80..a89ddd9ba68e 100644 --- a/include/linux/mfd/rk808.h +++ b/include/linux/mfd/rk808.h @@ -787,7 +787,7 @@ enum { }; struct rk808 { - struct i2c_client *i2c; + struct device *dev; struct regmap_irq_chip_data *irq_data; struct regmap *regmap; long variant;