From: Evan Green <evgreen@chromium.org>
To: Peter Rosin <peda@axentia.se>
Cc: Andy Shevchenko <andy.shevchenko@gmail.com>,
Wolfram Sang <wsa@kernel.org>,
Randy Dunlap <rdunlap@infradead.org>,
Evan Green <evgreen@chromium.org>,
Peter Korsgaard <peter.korsgaard@barco.com>,
linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [RESEND PATCH v3 1/2] i2c: i2c-mux-gpio: Factor out pdev->dev in _probe_dt()
Date: Wed, 18 Nov 2020 15:40:24 -0800 [thread overview]
Message-ID: <20201118153951.RESEND.v3.1.Ia45846771c63de3f2418d2b9c767cd95938a164c@changeid> (raw)
In-Reply-To: <20201118234025.376412-1-evgreen@chromium.org>
Factor out &pdev->dev into a local variable in preparation for
the ACPI enablement of this function, which will utilize the variable
more.
Signed-off-by: Evan Green <evgreen@chromium.org>
---
Changes in v3:
- Introduced minor &pdev->dev to dev refactor (Peter)
drivers/i2c/muxes/i2c-mux-gpio.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/i2c/muxes/i2c-mux-gpio.c b/drivers/i2c/muxes/i2c-mux-gpio.c
index 4effe563e9e8d..caaa782b50d83 100644
--- a/drivers/i2c/muxes/i2c-mux-gpio.c
+++ b/drivers/i2c/muxes/i2c-mux-gpio.c
@@ -53,6 +53,7 @@ static int i2c_mux_gpio_deselect(struct i2c_mux_core *muxc, u32 chan)
static int i2c_mux_gpio_probe_dt(struct gpiomux *mux,
struct platform_device *pdev)
{
+ struct device *dev = &pdev->dev;
struct device_node *np = pdev->dev.of_node;
struct device_node *adapter_np, *child;
struct i2c_adapter *adapter;
@@ -77,11 +78,11 @@ static int i2c_mux_gpio_probe_dt(struct gpiomux *mux,
mux->data.n_values = of_get_child_count(np);
- values = devm_kcalloc(&pdev->dev,
+ values = devm_kcalloc(dev,
mux->data.n_values, sizeof(*mux->data.values),
GFP_KERNEL);
if (!values) {
- dev_err(&pdev->dev, "Cannot allocate values array");
+ dev_err(dev, "Cannot allocate values array");
return -ENOMEM;
}
--
2.26.2
next prev parent reply other threads:[~2020-11-18 23:41 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-18 23:40 [RESEND PATCH v3 0/2] i2c: i2c-mux-gpio: Enable this driver in ACPI land Evan Green
2020-11-18 23:40 ` Evan Green [this message]
2021-01-15 9:30 ` [RESEND PATCH v3 1/2] i2c: i2c-mux-gpio: Factor out pdev->dev in _probe_dt() Peter Rosin
2021-01-17 11:53 ` Wolfram Sang
2020-11-18 23:40 ` [RESEND PATCH v3 2/2] i2c: i2c-mux-gpio: Enable this driver in ACPI land Evan Green
2020-11-19 15:25 ` Andy Shevchenko
2020-11-20 18:59 ` Evan Green
2020-11-30 19:11 ` Evan Green
2020-12-09 23:03 ` Evan Green
2021-01-05 10:25 ` Wolfram Sang
2021-01-14 18:17 ` Evan Green
2021-01-14 19:53 ` Wolfram Sang
2021-01-15 9:29 ` Peter Rosin
2021-01-19 12:10 ` Andy Shevchenko
2021-01-17 11:54 ` Wolfram Sang
2021-01-17 17:15 ` Evan Green
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201118153951.RESEND.v3.1.Ia45846771c63de3f2418d2b9c767cd95938a164c@changeid \
--to=evgreen@chromium.org \
--cc=andy.shevchenko@gmail.com \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=peda@axentia.se \
--cc=peter.korsgaard@barco.com \
--cc=rdunlap@infradead.org \
--cc=wsa@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).