Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752533AbdHNUpR (ORCPT ); Mon, 14 Aug 2017 16:45:17 -0400 Received: from mail-qt0-f174.google.com ([209.85.216.174]:35200 "EHLO mail-qt0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752061AbdHNUpP (ORCPT ); Mon, 14 Aug 2017 16:45:15 -0400 MIME-Version: 1.0 In-Reply-To: <20170814201425.20991-1-hdegoede@redhat.com> References: <20170814201425.20991-1-hdegoede@redhat.com> From: Andy Shevchenko Date: Mon, 14 Aug 2017 23:45:13 +0300 Message-ID: Subject: Re: [PATCH] platform/x86: intel_cht_int33fe: Work around BIOS bug on some devices To: Hans de Goede Cc: Darren Hart , Andy Shevchenko , Platform Driver , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1018 Lines: 31 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? > + *max17047 = to_i2c_client(dev); > + return 1; > + } > + > + return 0; > +} -- With Best Regards, Andy Shevchenko