Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752421AbdHNUwK (ORCPT ); Mon, 14 Aug 2017 16:52:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:30959 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752199AbdHNUwJ (ORCPT ); Mon, 14 Aug 2017 16:52:09 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com D3CCDAB084 Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=hdegoede@redhat.com Subject: Re: [PATCH] platform/x86: intel_cht_int33fe: Work around BIOS bug on some devices To: Andy Shevchenko Cc: Darren Hart , Andy Shevchenko , Platform Driver , "linux-kernel@vger.kernel.org" References: <20170814201425.20991-1-hdegoede@redhat.com> From: Hans de Goede Message-ID: <06a1d48c-9f75-4aab-107d-f71ce8ebbb26@redhat.com> Date: Mon, 14 Aug 2017 22:52:06 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Mon, 14 Aug 2017 20:52:09 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1341 Lines: 45 Hi, On 14-08-17 22:45, Andy Shevchenko wrote: > On Mon, Aug 14, 2017 at 11:14 PM, Hans de Goede 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; >> +} > >