From: Mika Westerberg <mika.westerberg@linux.intel.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
Andy Shevchenko <andy@kernel.org>,
Linus Walleij <linus.walleij@linaro.org>
Subject: Re: [PATCH v1 1/2] pinctrl: intel: Use temporary variable for struct device
Date: Thu, 3 Nov 2022 09:26:58 +0200 [thread overview]
Message-ID: <Y2NtQgRwkUlU5bMw@black.fi.intel.com> (raw)
In-Reply-To: <20221102152915.22995-1-andriy.shevchenko@linux.intel.com>
Hi,
On Wed, Nov 02, 2022 at 05:29:14PM +0200, Andy Shevchenko wrote:
> Use temporary variable for struct device to make code neater.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
> drivers/pinctrl/intel/pinctrl-intel.c | 23 ++++++++++++-----------
> 1 file changed, 12 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/pinctrl/intel/pinctrl-intel.c b/drivers/pinctrl/intel/pinctrl-intel.c
> index fe5bf2184cbf..e15629348cb5 100644
> --- a/drivers/pinctrl/intel/pinctrl-intel.c
> +++ b/drivers/pinctrl/intel/pinctrl-intel.c
> @@ -1522,14 +1522,15 @@ static int intel_pinctrl_probe_pwm(struct intel_pinctrl *pctrl,
> int intel_pinctrl_probe(struct platform_device *pdev,
> const struct intel_pinctrl_soc_data *soc_data)
> {
> + struct device *dev = &pdev->dev;
> struct intel_pinctrl *pctrl;
> int i, ret, irq;
>
> - pctrl = devm_kzalloc(&pdev->dev, sizeof(*pctrl), GFP_KERNEL);
> + pctrl = devm_kzalloc(dev, sizeof(*pctrl), GFP_KERNEL);
IMHO &pdev->dev is neater and saves an extra line. I would agree if this
would be something like &foo->bar->baz->dev but it is not.
Anyway, no feelings about this so feel free to add,
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
for both patches.
next prev parent reply other threads:[~2022-11-03 7:26 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-02 15:29 [PATCH v1 1/2] pinctrl: intel: Use temporary variable for struct device Andy Shevchenko
2022-11-02 15:29 ` [PATCH v1 2/2] pinctrl: merrifield: " Andy Shevchenko
2022-11-03 7:26 ` Mika Westerberg [this message]
2022-11-03 10:54 ` [PATCH v1 1/2] pinctrl: intel: " Andy Shevchenko
2022-11-03 11:44 ` Andy Shevchenko
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=Y2NtQgRwkUlU5bMw@black.fi.intel.com \
--to=mika.westerberg@linux.intel.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=andy@kernel.org \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.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