From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pali =?utf-8?B?Um9ow6Fy?= Subject: Re: [PATCH v2] i2c: i801: Register optional lis3lv02d i2c device on Dell machines Date: Sun, 28 Jan 2018 15:45:09 +0100 Message-ID: <20180128144509.pobnj7cayc4psgrj@pali> References: <20180127133209.28995-1-pali.rohar@gmail.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="fu7yxevz6pow27fd" Return-path: Content-Disposition: inline In-Reply-To: Sender: platform-driver-x86-owner@vger.kernel.org To: Andy Shevchenko 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 List-Id: linux-i2c@vger.kernel.org --fu7yxevz6pow27fd Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sunday 28 January 2018 16:39:25 Andy Shevchenko wrote: > On Sat, Jan 27, 2018 at 3:32 PM, Pali Roh=C3=A1r w= rote: > > +static bool is_dell_system_with_lis3lv02d(void) > > +{ >=20 > > + /* > > + * Check that ACPI device SMO88xx exists and is enabled. That A= CPI > > + * device represent our ST microelectronics lis3lv02d accelerom= eter but > > + * unfortunately without any other information (like i2c addres= s). > > + */ >=20 > Isn't it simple >=20 > return acpi_dev_present("SMO88", NULL, -1); >=20 > call? ACPI device name is SMO8800, SMO8810, ... Will that acpi_dev_present function match only prefix and not exact string? > > + found =3D false; > > + status =3D acpi_get_devices(NULL, check_acpi_smo88xx_device, NU= LL, > > + (void **)&found); > > + if (!ACPI_SUCCESS(status) || !found) > > + return false; > > + > > + return true; > > +} >=20 >=20 --=20 Pali Roh=C3=A1r pali.rohar@gmail.com --fu7yxevz6pow27fd Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQS4VrIQdKium2krgIWL8Mk9A+RDUgUCWm3h8wAKCRCL8Mk9A+RD UhL9AKCa7T1iAU8Dn+wkqCW36ktmrtQf/QCfQveRhexCX3Wwgj/ikwaFcmZKEZs= =svZr -----END PGP SIGNATURE----- --fu7yxevz6pow27fd--