From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751986AbeA1PAj (ORCPT ); Sun, 28 Jan 2018 10:00:39 -0500 Received: from mail-qt0-f178.google.com ([209.85.216.178]:34313 "EHLO mail-qt0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751362AbeA1PAh (ORCPT ); Sun, 28 Jan 2018 10:00:37 -0500 X-Google-Smtp-Source: AH8x225D4v4nCLjUnQoJLjVdTnbm6BaHiDmjiT7sXpaDJ/+CJwe0yiUtNXR1V0lXX4UgA7EHv05xyfWiZDq+C4zuhGo= MIME-Version: 1.0 In-Reply-To: <20180128144509.pobnj7cayc4psgrj@pali> References: <20180127133209.28995-1-pali.rohar@gmail.com> <20180128144509.pobnj7cayc4psgrj@pali> From: Andy Shevchenko Date: Sun, 28 Jan 2018 17:00:35 +0200 Message-ID: Subject: Re: [PATCH v2] i2c: i801: Register optional lis3lv02d i2c device on Dell machines To: =?UTF-8?Q?Pali_Roh=C3=A1r?= Cc: Jean Delvare , Wolfram Sang , =?UTF-8?B?TWljaGHFgiBLxJlwaWXFhA==?= , Steven Honeyman , Valdis Kletnieks , Jochen Eisinger , Gabriele Mazzotta , Andy Lutomirski , Mario Limonciello , Alex Hung , Takashi Iwai , linux-i2c , Linux Kernel Mailing List , Platform Driver 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-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.home.local id w0SF0kM4010161 On Sun, Jan 28, 2018 at 4:45 PM, Pali Rohár wrote: > On Sunday 28 January 2018 16:39:25 Andy Shevchenko wrote: >> On Sat, Jan 27, 2018 at 3:32 PM, Pali Rohár wrote: >> > +static bool is_dell_system_with_lis3lv02d(void) >> > +{ >> >> > + /* >> > + * Check that ACPI device SMO88xx exists and is enabled. That ACPI >> > + * device represent our ST microelectronics lis3lv02d accelerometer but >> > + * unfortunately without any other information (like i2c address). >> > + */ >> >> Isn't it simple >> >> return acpi_dev_present("SMO88", NULL, -1); >> >> call? > > ACPI device name is SMO8800, SMO8810, ... Will that acpi_dev_present > function match only prefix and not exact string? OK, fair enough. Do we have more users of such pattern? If so, it might make sense to introduce a generic helper for that which takes a list of HIDs on input. (Yes, I do not like matching pattern like "XYZhh*", I prefer explicit list of HIDs. Rationale to do so: a) any new potential collision is excluded, b) we can easily grep kernel for a users per HID) -- With Best Regards, Andy Shevchenko