From patchwork Thu Oct 20 20:42:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Reichel X-Patchwork-Id: 6385 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp315348wrr; Thu, 20 Oct 2022 13:46:38 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5LbKcclW/K9cxcx6Zk3v9BKPOgcocR/MV8uL7CdnqNluHWFJ6dexDXse32L3vd0GYglskH X-Received: by 2002:a17:906:99c3:b0:78d:9cc9:deda with SMTP id s3-20020a17090699c300b0078d9cc9dedamr12567423ejn.712.1666298798529; Thu, 20 Oct 2022 13:46:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666298798; cv=none; d=google.com; s=arc-20160816; b=eKqUsewmV8Q/iQPVAeLeRFcZIsZriYtxquDN7zewdS4qm2h64RvNQ4FF+x13Qx+bB4 VC0200CQMBNih+YTf3i7sseS9hPzMIxfQ0c0kp+NUu8gvlbs7gLL1jx1NzOwoO5MU/1m wjcDhfLGORNbMVk3n99319OuvlpAFm4qdGlG11HjYAuQdKsTY8gaXhAbXWd+l0JqRRg5 pc2gjRxspT3YyPAwWSXpPQNw0pYQB5mn3KhE4RZdxer4rrSo3MJpFRrFjmLw3Kke+kxy l7XvlV8xCc29lGhusXVyMbzIvUz/skBljb/eqWyfFPk/lydyyBqxe0mCiH66pl8Sos/n BdrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=8ahXRfJK/6ZhY73DeDT+DbRXs4LzMyySYEgIZXhXVX0=; b=rkYBLjeI/9IzknumtIW0QrOwJaTpbsILg62E7XB4oCMonp/t5IKsL6Y77/YSbizzq5 DAntDAwvpCLxy47nzHc6Bc5HKx/66h2WDCB6PVdCLPcPYdquiEf1IHqGH+BwM1ubpG4q GvsbNFXA6lORD3rBZ8DTiG6JIFUmQGUPTB/j6yGmvXW4jHxE+PBxn/pWxS+3SbfmGlqr 7LkyjW3yxVyQVY1Wogff7ofWWAnlyyMj46xzYThxbP8pLJbq3aTk1SEZF+aFczf+Wm/B OEA6Rl106WXAaKN/67IvVCpIplMqNzRvBVX3f+h406UnFWCnmsnI9I6LRXyoPTHqp8m2 V/Ow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=kgATtfN9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t19-20020a056402525300b00458ebf5aee0si20660477edd.344.2022.10.20.13.46.14; Thu, 20 Oct 2022 13:46:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=kgATtfN9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229841AbiJTUnk (ORCPT + 99 others); Thu, 20 Oct 2022 16:43:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33992 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229675AbiJTUnN (ORCPT ); Thu, 20 Oct 2022 16:43:13 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3BBB01F9A27; Thu, 20 Oct 2022 13:43:12 -0700 (PDT) Received: from jupiter.universe (dyndsl-091-096-059-009.ewe-ip-backbone.de [91.96.59.9]) (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 7DFE96602544; Thu, 20 Oct 2022 21:42:57 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1666298577; bh=ufnEoBIW4CTlDBjILfeMeTTKD/EZUayw8ybMcQdQgWI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kgATtfN9RU2fN3U0bZLh9Ddl2xWUteYSXJ0Wn08PPHNU5UdGF2Hz7K2OBhzbv05yU VUHXfJS9xHQgl78grpCOJSvqmmpx/h47OQMzE0uYIsA76fxH+loLwbunceso0R3Zpg tbolzjbMuOOJt+vaEJuBQR72f/4mT58U613he5OCPup+8BQJHEsyDl83MGLee1aOzU ViZlM3v6+VxEQtzIujp3rl91G2WxvRknVvohLx/6M2jsdFQ5hUkJhqf5zTlxINmxeo EflpWPk3WL3x7wUAA+VWGmmflRYULnBfJ3myxMEN55z+2pgs5yM5NJoRkE9Sbx7nx2 tdcTe44x7BUfg== Received: by jupiter.universe (Postfix, from userid 1000) id 5B25B48089B; Thu, 20 Oct 2022 22:42:52 +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: [PATCHv4 06/13] mfd: rk808: replace 'struct i2c_client' with 'struct device' Date: Thu, 20 Oct 2022 22:42:44 +0200 Message-Id: <20221020204251.108565-7-sebastian.reichel@collabora.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221020204251.108565-1-sebastian.reichel@collabora.com> References: <20221020204251.108565-1-sebastian.reichel@collabora.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747240928543145526?= X-GMAIL-MSGID: =?utf-8?q?1747240928543145526?= 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 5e0e5f320525..b154ca96d812 100644 --- a/drivers/mfd/rk808.c +++ b/drivers/mfd/rk808.c @@ -570,7 +570,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; } @@ -593,7 +593,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; } @@ -714,7 +714,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;