Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp894911imm; Fri, 29 Jun 2018 08:05:27 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcp4utvrFnjr/mK2pd4GttsDWpzJfLzdhtAlhJNa+CJM9rorjcAP7siUcasXjBrCLgfiuVN X-Received: by 2002:a62:1e81:: with SMTP id e123-v6mr14738906pfe.188.1530284727158; Fri, 29 Jun 2018 08:05:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530284727; cv=none; d=google.com; s=arc-20160816; b=RT7pNqcfpx/YqsbuHh6LdebX5phtsu0s/RceEp6lhzjbVOn58PN3UP/w234eYs7fj8 /Lr6qp9MFw+r9XCRpPm1AfP9UG//rAhBt68RRMT4yxeadNgLQAb5uhse66fUwIY4kkBf TL9IJqyOjPxp+KNCRgcoYtduM4YuB2f4mta2hW2dtE2JgHdLXv5sR8wgUaOxAVA3GdGW 1YoiqhSzgjgNGu6S03d+uYH1RUhXgB3Hs0RMC5N3WZbvmKFmp44dSosC+5VICZiKlbrG wEFJC3x4omfmadJbt6Jl9gKM/sArepE6x28fQm357DUkSMHSLwiiUMV92J7ly26M2J3i nlwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:date:from:message-id :arc-authentication-results; bh=ydE1znpO3OmhmQ3rMD4e3QDiUzckarRx6PwQGZKr3Wk=; b=cfUyuQBfd2S6alX2wtlsQl/JI0syNfa0E7hOu6i5FeBs/5kim0bGhF5acG38Pg237V INtOo9Bn272vB9Lom+Zi4fZwaTklet6xnC0vGz+OGThc83vkBcsUbf+XkDRoz1+7eqIw I2S4ewCKYLqb1d2mp466/ZGeE2EZXDg9sSs1RO2+kelwdxCO/6Lkd1Jw3sZGcHx4+Bs5 AjnHyP9VMY/ggTXFZCodWHPG13O0hjPvPwc8wIN7avap9fl8JZjU5TY5ajrYK4kp9cyK BoDhRPfZydzVaVSRxTWeI6keODG79vSFjux9Kub23stWtuJbWQsp42Laeu+3RWtiWeET gTvA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v21-v6si8681366pgn.371.2018.06.29.08.05.01; Fri, 29 Jun 2018 08:05:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964785AbeF2LPg (ORCPT + 99 others); Fri, 29 Jun 2018 07:15:36 -0400 Received: from mail.steuer-voss.de ([85.183.69.95]:51590 "EHLO mail.steuer-voss.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933159AbeF2LPd (ORCPT ); Fri, 29 Jun 2018 07:15:33 -0400 X-Virus-Scanned: Debian amavisd-new at mail.steuer-voss.de Received: by mail.steuer-voss.de (Postfix, from userid 1000) id DEE8F41BD7; Fri, 29 Jun 2018 13:05:25 +0200 (CEST) Message-Id: From: Nikolaus Voss Date: Fri, 29 Jun 2018 12:30:35 +0200 Subject: [PATCH 0/3] IIO: st_sensors_i2c: improve device enumeration To: Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , Lorenzo Bianconi , Linus Walleij , Xiongfeng Wang Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When trying to instantiate a st_accel_i2c device from an ACPI based system, I ran into some problems: For my device, there is no ACPI match table entry, so rather than creating /allocating a new ACPI HID for the device, I wanted to use an existing DT table compatible entry via creating an ACPI_DT_NAMESPACE_HID /PRP0001 HID ACPI entry (see Documentation/acpi/enumeration.txt). This did not work because st_accel_i2c.c bails out if there is a ACPI node but no ACPI table match instead of looking for a match from one of the fallback mechanisms (patch 1). Patch 2 removes an error message when a ACPI node exists but no table entry is found (this doesn't need to be fatal because of the fallback). Patch 3 syncs the strings in the I2C device table (which is used by the I2C core for fallback matching) with the DT compatible strings, so a PRP0001 entry can use the same compatible strings as a corresponding DT entry. As far as I can see, the old I2C table strings aren't used in mainline, so renaming them should be safe. Nikolaus Voss (3): IIO: st_accel_i2c.c: Use fallback if DT/ACPI enum failed IIO: st_sensors_i2c.c: Don't print error on failed ACPI match IIO: st_accel.h: sync DT and I2C device ID table strings drivers/iio/accel/st_accel.h | 32 +++++++++---------- drivers/iio/accel/st_accel_i2c.c | 21 ++++++------ .../iio/common/st_sensors/st_sensors_i2c.c | 5 ++- 3 files changed, 30 insertions(+), 28 deletions(-) -- 2.17.1