mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Darren Hart <dvhart@infradead.org>,
	Andy Shevchenko <andy@infradead.org>,
	Platform Driver <platform-driver-x86@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] platform/x86: intel_cht_int33fe: Work around BIOS bug on some devices
Date: Mon, 14 Aug 2017 22:52:06 +0200	[thread overview]
Message-ID: <06a1d48c-9f75-4aab-107d-f71ce8ebbb26@redhat.com> (raw)
In-Reply-To: <CAHp75Vdityzx+fzU_q0vULGpT3ww8C0_D0fYtEW77Hyh1yTX6A@mail.gmail.com>

Hi,

On 14-08-17 22:45, Andy Shevchenko wrote:
> On Mon, Aug 14, 2017 at 11:14 PM, Hans de Goede <hdegoede@redhat.com> wrote:
>> At least one BIOS enumerates the max17047 both through the INT33FE ACPI
>> device (it is right there in the resources table) as well as through a
>> separate MAX17047 device.
>>
>> This commit checks for the max17047 already being enumerated through
>> a separate MAX17047 ACPI device and if so it uses the i2c-client
>> instantiated for this and attaches the device-props for the max17047 to
>> that i2c-client.
> 
>> +int cht_int33fe_check_for_max17047(struct device *dev, void *data)
>> +{
>> +       const char *name = dev_name(dev);
>> +       struct i2c_client **max17047 = data;
>> +
>> +       if (name && strcmp(name, "i2c-MAX17047:00") == 0) {
> 
> Can we stop using bad practice of comparing against _instance_?
> If device is suppose to be single in the system, wouldn't _HID be enough?

Yes _HID would be enough, but that takes some extra code with little
gain IMHO, we are effectively checking the HID here as that is where
the device-name comes from.

Anyways if you strongly prefer a HID check I can do a v2 doing that
either way let me know.

Regards,

Hans



> 
>> +               *max17047 = to_i2c_client(dev);
>> +               return 1;
>> +       }
>> +
>> +       return 0;
>> +}
> 
> 

  reply	other threads:[~2017-08-14 20:52 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-14 20:14 Hans de Goede
2017-08-14 20:45 ` Andy Shevchenko
2017-08-14 20:52   ` Hans de Goede [this message]
2017-08-31 16:04     ` Andy Shevchenko
2017-09-01  6:25       ` Jarkko Nikula
2017-09-01  9:19       ` Mika Westerberg
2017-09-01 21:58         ` Hans de Goede
2017-09-02  7:16           ` Mika Westerberg
2017-08-31 15:04 ` Hans de Goede

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=06a1d48c-9f75-4aab-107d-f71ce8ebbb26@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=andy@infradead.org \
    --cc=dvhart@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=platform-driver-x86@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

all inboxes | Powered by JetHome®