From patchwork Tue Mar 7 15:36:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Reichel X-Patchwork-Id: 13163977 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 AC954C6FD1A for ; Tue, 7 Mar 2023 15:36:52 +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=9e/Q+YW9CcY+Uuf027FBO/yClfpkgBsoEBufiOM7V8I=; b=KlsfDx/8KiAY8e /dyQd87sSDGBLJ1+KW+cgswMU0pLzd9l9tTH3DXzk/kmkAYn/4HVsdrq4oPvBomtCqt3vQsXttj2Z ade0XSr+TEbF3J2c5REviIDd0dcTh0NIvdKhy72+GUDMAMW6+p3aUOvOMKH00DCm+nGkIYEAiRwNy KDEcTVKk4cuiWgvYkJfypy3oFt6oRA8lUaX94nFufaKPtQ3yd3BX4dqxhevb7Brtgg2Ha7Si4Lclz g7V3lVUyIKBkYWfmOyeRBDy8/SI9k3F6qFKDiNU9t5FazAHrA+NKtGNFAQ1ijdTfjKuhKXAz7gLGY uzsjQfLcX5WEoIBj2a7w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pZZMc-001GPi-T0; Tue, 07 Mar 2023 15:36:30 +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 1pZZMX-001GKm-Dt for linux-rockchip@lists.infradead.org; Tue, 07 Mar 2023 15:36:28 +0000 Received: from jupiter.universe (dyndsl-091-248-189-073.ewe-ip-backbone.de [91.248.189.73]) (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 387496602FD5; Tue, 7 Mar 2023 15:36:21 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1678203381; bh=gFkKz0bU2hPW20yYU/Ijaa/eBEPlNPFAVxN7ySLgbZ0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HA2w7Csnmssy05Q8YbjlCx/iTtDJ1t1ZdhctNpRHsNRkycsfJ+PS7VG0NgmieSyW2 iqJ2zU6SV7Q+37jNdh4htXsql6h7tTViU+EL67/64x7MDM/BGBNszKR0KvLt0vHouo +T1mqke1FI9qcr2uk4zZuiJ1kid/G2nr0L0fH0Tbui+oLiRh1q4mx4DO3pRTlVILRO hAIZOV766BG/JpSV62jVMwBsiCEHhS6D+L4qdrkBsW3SsLA92MZ2yYW+IlIeVWUyk8 2DY3UVxd/KRFy0QO9u+kWoD2gI4TkWZRMWk+VeMzLtnZgnVRUpS3ELkT7B53/vwQtf 1aB1+ElMDtWvw== Received: by jupiter.universe (Postfix, from userid 1000) id 2687B48011C; Tue, 7 Mar 2023 16:36:19 +0100 (CET) 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: [PATCHv7 04/11] mfd: rk808: replace 'struct i2c_client' with 'struct device' Date: Tue, 7 Mar 2023 16:36:10 +0100 Message-Id: <20230307153617.643260-5-sebastian.reichel@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230307153617.643260-1-sebastian.reichel@collabora.com> References: <20230307153617.643260-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-20230307_073625_637619_2C33913B X-CRM114-Status: GOOD ( 13.53 ) 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 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;