From: Guenter Roeck <linux@roeck-us.net>
To: Joaquin Aramendia <samsagax@gmail.com>
Cc: derekjohn.clark@gmail.com, jdelvare@suse.com,
linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] hwmon: (oxp-sensors) Add tt_toggle attribute on supported boards
Date: Fri, 9 Jun 2023 07:37:08 -0700 [thread overview]
Message-ID: <363c1fc1-5ed7-8a21-a627-58d1338c446f@roeck-us.net> (raw)
In-Reply-To: <CABgtM3iOyCDgDY1gj-gJ4DXaXCY41FKzy-=miz0iiT8ywjbMHg@mail.gmail.com>
On 6/9/23 05:50, Joaquin Aramendia wrote:
>> Why don't you just attach the attribute to the platform device as I
>> had suggested earlier ?
>
> You mean I should do something like this in probe():
>
> static int oxp_platform_probe(struct platform_device *pdev)
> {
> ...
>
> switch (board) {
> case aok_zoe_a1:
> case oxp_mini_amd_a07:
> case oxp_mini_amd_pro:
> pdev->dev.groups = oxp_ec_groups;
> }
> hwdev = devm_hwmon_device_register_with_info(dev, "oxpec", NULL,
> &oxp_ec_chip_info, NULL);
> ...
> }
>
> Would that work? Or even be correct?
No, that would not work, because the platform device already exists.
It would have to be added in the init function, or if done in the probe
function it would have to be added to the platform device with an
explicit call to devm_device_add_group().
Guenter
prev parent reply other threads:[~2023-06-09 14:37 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-27 1:22 Joaquín Ignacio Aramendía
2023-05-28 23:52 ` Guenter Roeck
2023-05-31 12:04 ` Joaquin Aramendia
2023-05-31 16:46 ` Guenter Roeck
2023-06-07 12:40 ` Joaquin Aramendia
2023-06-07 17:33 ` Guenter Roeck
2023-06-09 12:50 ` Joaquin Aramendia
2023-06-09 14:37 ` Guenter Roeck [this message]
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=363c1fc1-5ed7-8a21-a627-58d1338c446f@roeck-us.net \
--to=linux@roeck-us.net \
--cc=derekjohn.clark@gmail.com \
--cc=jdelvare@suse.com \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=samsagax@gmail.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
all inboxes | Powered by JetHome®