From patchwork Fri Sep 9 17:55:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Reichel X-Patchwork-Id: 12972021 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 0331FECAAD5 for ; Fri, 9 Sep 2022 17:55:47 +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=xWs6ZAa/MI2+XzetOCstv90icNTwbfxt7XYrioZmbho=; b=4TXp3ajZy9U2Ea 9Os5npCiCCZpoaY9til9tKW+2D5bbX88cqkb0ABEHlUyBopNJE7e9ygZB0ffa4i3ZKBDAyktUBuP0 pene0BVUVSnnPDDJt7b0iffcaCd9TShbIeu5d0UaLVaqpL8vtb+DZqGs67w4xZFt7NqBhaizOFtSp PKFMAvqjI8Fgszk064JqHysBSnJN3fwsAXCW4ZME/DOsc1c/ASG3CDPtMXJ4XwNQf9U0DTgW1ynzo NKqUlYJdriMxrjLc+oHEI0EbxsOucdGy10hvvSfx+tSnG6CCOQhI7uuZJjfITPebMDtvc5p66TLQV bBcJB8w7knkLMCD9/iTQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oWiE8-000tyD-Nh; Fri, 09 Sep 2022 17:55:40 +0000 Received: from madras.collabora.co.uk ([2a00:1098:0:82:1000:25:2eeb:e5ab]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oWiE3-000toX-TQ for linux-rockchip@lists.infradead.org; Fri, 09 Sep 2022 17:55:37 +0000 Received: from jupiter.universe (dyndsl-095-033-168-128.ewe-ip-backbone.de [95.33.168.128]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: sre) by madras.collabora.co.uk (Postfix) with ESMTPSA id EB1196601FD7; Fri, 9 Sep 2022 18:55:30 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1662746131; bh=wCJsNLkxYKL/el2Fx65/D1FjMyWbbflEjA0WI2oWEFg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hJL7pc1ft8/OpM9pgb/9/GAgFhUtk2kYp+lfMx28driYknAU66BolV8TeMD6ZUJP3 zSZVlIG3IImPFKuK83lqQwL956cEqJu2bFz+Fex94XlkbknLreF4NAhsUcLayQGFFl D7ByEVY0uZfhFtGr24Xf8GS/+RWUKSae2ybk0eFB7Q/A6ot9RnQKC/mWAW7Mpls5k4 xKH1ZHS2Tau+b8bHCxMJKCpajvjkNCknykro5L8nuehQMgkz2x8WrRz1UPMLc++rNR TlmO4vUtdO3Uyulsu29GgmThyQJX5cEsxi6HS6qRG0b+mpKoyoJeZU7WIaWd4S2G2O b2/kRA7K9MpUw== Received: by jupiter.universe (Postfix, from userid 1000) id 1FD0D48044C; Fri, 9 Sep 2022 19:55:27 +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 Subject: [PATCHv3 06/14] mfd: rk808: replace 'struct i2c_client' with 'struct device' Date: Fri, 9 Sep 2022 19:55:14 +0200 Message-Id: <20220909175522.179175-7-sebastian.reichel@collabora.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220909175522.179175-1-sebastian.reichel@collabora.com> References: <20220909175522.179175-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-20220909_105536_097478_E4E3C0AC X-CRM114-Status: GOOD ( 14.15 ) 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. 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 8b18a9d9cb74..518c6deec4b1 100644 --- a/drivers/mfd/rk808.c +++ b/drivers/mfd/rk808.c @@ -556,7 +556,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; } @@ -579,7 +579,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; } @@ -700,7 +700,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 58602032e642..9937b068fa82 100644 --- a/include/linux/mfd/rk808.h +++ b/include/linux/mfd/rk808.h @@ -696,7 +696,7 @@ enum { }; struct rk808 { - struct i2c_client *i2c; + struct device *dev; struct regmap_irq_chip_data *irq_data; struct regmap *regmap; long variant;