Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751928AbdHaQEu (ORCPT ); Thu, 31 Aug 2017 12:04:50 -0400 Received: from mail-qk0-f196.google.com ([209.85.220.196]:36187 "EHLO mail-qk0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751760AbdHaQEs (ORCPT ); Thu, 31 Aug 2017 12:04:48 -0400 X-Google-Smtp-Source: ADKCNb5lFhFMqRFHMIt4rTWIBL7w4DpeGpTKkuox+D1P6nhVP6R+wylfCQdBH/h5szK7nxjwbK/O9qg6UClB1TtvcMc= MIME-Version: 1.0 In-Reply-To: <06a1d48c-9f75-4aab-107d-f71ce8ebbb26@redhat.com> References: <20170814201425.20991-1-hdegoede@redhat.com> <06a1d48c-9f75-4aab-107d-f71ce8ebbb26@redhat.com> From: Andy Shevchenko Date: Thu, 31 Aug 2017 19:04:46 +0300 Message-ID: Subject: Re: [PATCH] platform/x86: intel_cht_int33fe: Work around BIOS bug on some devices To: Hans de Goede , "Rafael J. Wysocki" , Mika Westerberg Cc: Darren Hart , Andy Shevchenko , Platform Driver , "linux-kernel@vger.kernel.org" , "linux-acpi@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: 1371 Lines: 43 On Mon, Aug 14, 2017 at 11:52 PM, Hans de Goede wrote: > On 14-08-17 22:45, Andy Shevchenko wrote: >> On Mon, Aug 14, 2017 at 11:14 PM, Hans de Goede >> wrote: >>> +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. Currently we have the following modules where ACPI instance is used in: drivers/acpi/acpi_lpss.c drivers/input/touchscreen/goodix.c drivers/platform/x86/silead_dmi.c drivers/power/supply/axp288_charger.c and plenty under sound/soc/intel. I do not care right now about sound/soc/intel stuff, while everywhere else would be better to avoid this. Mika, Rafael, what're yours opinions regarding to use ACPI instances in the drivers? For me it sounds fragile. -- With Best Regards, Andy Shevchenko