From: Joel Stanley <joel@jms.id.au>
To: Tian Tao <tiantao6@hisilicon.com>
Cc: linux-hwmon@vger.kernel.org, Jean Delvare <jdelvare@suse.com>,
linux-aspeed <linux-aspeed@lists.ozlabs.org>,
Andrew Jeffery <andrew@aj.id.au>,
Linux ARM <linux-arm-kernel@lists.infradead.org>,
Philipp Zabel <p.zabel@pengutronix.de>,
Guenter Roeck <linux@roeck-us.net>
Subject: Re: [PATCH] hwmon: (aspeed-pwm-tacho): Switch to using the new API kobj_to_dev()
Date: Mon, 4 Jan 2021 02:12:58 +0000 [thread overview]
Message-ID: <CACPK8XdvL9yacNKkZ4Ut8b2m9jFrMv=Ri-8qn1DSu0547ZecGw@mail.gmail.com> (raw)
In-Reply-To: <1609725945-13895-1-git-send-email-tiantao6@hisilicon.com>
On Mon, 4 Jan 2021 at 02:05, Tian Tao <tiantao6@hisilicon.com> wrote:
>
> fixed the following coccicheck:
> drivers/hwmon/aspeed-pwm-tacho.c:634:60-61: WARNING opportunity for
> kobj_to_dev()
> drivers/hwmon/aspeed-pwm-tacho.c:623:60-61: WARNING opportunity for
> kobj_to_dev()
>
> Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
Acked-by: Joel Stanley <joel@jms.id.au>
> ---
> drivers/hwmon/aspeed-pwm-tacho.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/hwmon/aspeed-pwm-tacho.c b/drivers/hwmon/aspeed-pwm-tacho.c
> index 3d8239f..3cb88d6 100644
> --- a/drivers/hwmon/aspeed-pwm-tacho.c
> +++ b/drivers/hwmon/aspeed-pwm-tacho.c
> @@ -620,7 +620,7 @@ static ssize_t rpm_show(struct device *dev, struct device_attribute *attr,
> static umode_t pwm_is_visible(struct kobject *kobj,
> struct attribute *a, int index)
> {
> - struct device *dev = container_of(kobj, struct device, kobj);
> + struct device *dev = kobj_to_dev(kobj);
> struct aspeed_pwm_tacho_data *priv = dev_get_drvdata(dev);
>
> if (!priv->pwm_present[index])
> @@ -631,7 +631,7 @@ static umode_t pwm_is_visible(struct kobject *kobj,
> static umode_t fan_dev_is_visible(struct kobject *kobj,
> struct attribute *a, int index)
> {
> - struct device *dev = container_of(kobj, struct device, kobj);
> + struct device *dev = kobj_to_dev(kobj);
> struct aspeed_pwm_tacho_data *priv = dev_get_drvdata(dev);
>
> if (!priv->fan_tach_present[index])
> --
> 2.7.4
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2021-01-04 2:15 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-04 2:05 [PATCH] hwmon: (aspeed-pwm-tacho): Switch to using the new API kobj_to_dev() Tian Tao
2021-01-04 2:12 ` Joel Stanley [this message]
2021-01-08 15:35 ` Guenter Roeck
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='CACPK8XdvL9yacNKkZ4Ut8b2m9jFrMv=Ri-8qn1DSu0547ZecGw@mail.gmail.com' \
--to=joel@jms.id.au \
--cc=andrew@aj.id.au \
--cc=jdelvare@suse.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-aspeed@lists.ozlabs.org \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=p.zabel@pengutronix.de \
--cc=tiantao6@hisilicon.com \
/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).