From: Guenter Roeck <linux@roeck-us.net>
To: Heiner Kallweit <hkallweit1@gmail.com>, linux-kernel@vger.kernel.org
Cc: "Arnd Bergmann" <arnd@arndb.de>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Thomas Weißschuh" <linux@weissschuh.net>
Subject: Re: [PATCH 1/2] eeprom: ee1004: Call i2c_new_scanned_device to instantiate thermal sensor
Date: Sat, 29 Jun 2024 15:26:46 -0700 [thread overview]
Message-ID: <2ecdfad0-df83-498a-b487-b8c52def0bce@roeck-us.net> (raw)
In-Reply-To: <e519e9f2-5e25-4ec3-afb4-42d15da941aa@gmail.com>
On 6/29/24 15:00, Heiner Kallweit wrote:
> On 29.06.2024 19:37, Guenter Roeck wrote:
>> Instantiating a device by calling i2c_new_client_device() assumes that the
>> device is not already instantiated. If that is not the case, it will return
>> an error and generate a misleading kernel log message.
>>
>> i2c i2c-0: Failed to register i2c client jc42 at 0x18 (-16)
>>
>> This can be reproduced by unloading the ee1004 driver and loading it again.
>>
>> Avoid this by calling i2c_new_scanned_device() instead, which returns
>> silently if a device is already instantiated or does not exist.
>>
> However i2c_new_scanned_device() runs i2c_default_probe() on the device,
> whilst i2c_new_client_device() doesn't access the i2c bus.
> If possible I'd like to avoid this overhead.
>
I am not as much concerned with that overhead since there are already several
other i2c accesses in both this driver and in the jc42 driver, so it seemed to
me that another quick operation does not make much of a difference. Also, I
wanted to suggest a solution which does not require changing the i2c core.
However, I am not "married" to this solution. Please feel free to suggest
something different, or to drop this patch (and the next one) entirely.
Thanks,
Guenter
prev parent reply other threads:[~2024-06-29 22:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-29 17:37 Guenter Roeck
2024-06-29 17:37 ` [PATCH 2/2] eeprom: ee1004: Instantiate jc42 devices for DIMMS implementing Rev.1 SPD Guenter Roeck
2024-06-29 22:00 ` [PATCH 1/2] eeprom: ee1004: Call i2c_new_scanned_device to instantiate thermal sensor Heiner Kallweit
2024-06-29 22:26 ` 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=2ecdfad0-df83-498a-b487-b8c52def0bce@roeck-us.net \
--to=linux@roeck-us.net \
--cc=arnd@arndb.de \
--cc=gregkh@linuxfoundation.org \
--cc=hkallweit1@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@weissschuh.net \
/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®