All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Gupta, Akshay" <Akshay.Gupta@amd.com>
To: Arnd Bergmann <arnd@arndb.de>,
	linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Guenter Roeck <linux@roeck-us.net>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	shyam-sundar.s-k@amd.com, gautham.shenoy@amd.com,
	Mario Limonciello <mario.limonciello@amd.com>,
	naveenkrishna.chatradhi@amd.com, anand.umarji@amd.com
Subject: Re: [PATCH v7 03/10] misc: amd-sbi: Move hwmon device sensor as separate entity
Date: Mon, 7 Apr 2025 17:01:16 +0530	[thread overview]
Message-ID: <cdd4c767-1981-49ec-82ff-2fd685f387c5@amd.com> (raw)
In-Reply-To: <af416dbf-240c-4c21-954f-d69420f6bd3d@app.fastmail.com>


On 4/2/2025 4:33 PM, Arnd Bergmann wrote:
> Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.
>
>
> On Wed, Apr 2, 2025, at 07:58, Akshay Gupta wrote:
>
>> +
>> +int create_hwmon_sensor_device(struct device *dev, struct sbrmi_data *data)
>> +{
>> +     if (IS_REACHABLE(CONFIG_HWMON)) {
>> +             struct device *hwmon_dev;
>> +
>> +             hwmon_dev = devm_hwmon_device_register_with_info(dev, "sbrmi", data,
>> +                                                              &sbrmi_chip_info, NULL);
>> +             return PTR_ERR_OR_ZERO(hwmon_dev);
>> +     }
>> +     return 0;
> I just one more problems with this bit. This was already in the
> existing code, but should still be addressed:
>
> Using IS_REACHABLE() is usually a sign that the Kconfig dependencies
> are wrong. Fix the dependencies instead so the hwmon driver can
> only be enabled if the subsystem is enabled. You can either add a
> separate Kconfig symbol or make the driver 'depends on HWMON || !HWMON'
> to express this.
>
>         Arnd

Thanks Arnd,

I will create a new Kconfig symbol for HWMON changes to enable only when 
subsystem is enabled.


  reply	other threads:[~2025-04-07 11:31 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-02  5:58 [PATCH v7 00/10] misc: Move AMD side band interface(SBI) functionality Akshay Gupta
2025-04-02  5:58 ` [PATCH v7 01/10] hwmon/misc: amd-sbi: Move core sbrmi from hwmon to misc Akshay Gupta
2025-04-02  5:58 ` [PATCH v7 02/10] misc: amd-sbi: Move protocol functionality to core file Akshay Gupta
2025-04-02  5:58 ` [PATCH v7 03/10] misc: amd-sbi: Move hwmon device sensor as separate entity Akshay Gupta
2025-04-02 11:03   ` Arnd Bergmann
2025-04-07 11:31     ` Gupta, Akshay [this message]
2025-04-02  5:58 ` [PATCH v7 04/10] misc: amd-sbi: Use regmap subsystem Akshay Gupta
2025-04-02  5:58 ` [PATCH v7 05/10] misc: amd-sbi: Optimize the wait condition for mailbox command completion Akshay Gupta
2025-04-02  5:58 ` [PATCH v7 06/10] misc: amd-sbi: Add support for AMD_SBI IOCTL Akshay Gupta
2025-04-02  5:58 ` [PATCH v7 07/10] misc: amd-sbi: Add support for CPUID protocol Akshay Gupta
2025-04-02 12:13   ` Arnd Bergmann
2025-04-02 12:16     ` Greg Kroah-Hartman
2025-04-07 11:31       ` Gupta, Akshay
2025-04-02  5:58 ` [PATCH v7 08/10] misc: amd-sbi: Add support for read MCA register protocol Akshay Gupta
2025-04-02  5:58 ` [PATCH v7 09/10] misc: amd-sbi: Add support for register xfer Akshay Gupta
2025-04-02  5:58 ` [PATCH v7 10/10] misc: amd-sbi: Add document for AMD SB IOCTL description Akshay Gupta

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=cdd4c767-1981-49ec-82ff-2fd685f387c5@amd.com \
    --to=akshay.gupta@amd.com \
    --cc=anand.umarji@amd.com \
    --cc=arnd@arndb.de \
    --cc=gautham.shenoy@amd.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=mario.limonciello@amd.com \
    --cc=naveenkrishna.chatradhi@amd.com \
    --cc=shyam-sundar.s-k@amd.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.