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: 604319 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C429FECAAD3 for ; Fri, 9 Sep 2022 17:55:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231725AbiIIRzj (ORCPT ); Fri, 9 Sep 2022 13:55:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57694 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230283AbiIIRzf (ORCPT ); Fri, 9 Sep 2022 13:55:35 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E65BA4B3E; Fri, 9 Sep 2022 10:55:33 -0700 (PDT) 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 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.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;