Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1246429imm; Fri, 29 Jun 2018 14:16:48 -0700 (PDT) X-Google-Smtp-Source: AAOMgpd83UGtZO4XVDfJV83Uk+DWqlpLQSI4qFeM69wE38LQOuH00EOQdcG5ofRAZVhHUG6TMe9D X-Received: by 2002:a65:6258:: with SMTP id q24-v6mr1782268pgv.131.1530307008301; Fri, 29 Jun 2018 14:16:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530307008; cv=none; d=google.com; s=arc-20160816; b=WWjUs2InNk5f2cC8AYy/gm1pdfthPUjLUDk0GZr29EUSy4KS2fMfcjAFcu1zV0HlIg 8eTYeueXYJ+qWTpm+RFlaVU3RAEqr0zF8NIqU2Xl/T0LEwodM3ebh1yMBN2q46MAcNlo Qs4zLAg/5sVOHtVViYKNDYhQP6UMWpJw4h0A/j90ePVOKcdFyXBk8TTV6BDuo5rW0X11 5F7AvMhOzhq4qqZfUbh100yrYXCla00K7IfZL58qWaMWKIBxxI1sJPgNSNYRSUVugEX8 pdoeZU3Z2957x8uC8Iv7sNLV1TGiVNxYxQjweg/LmTFNSi6RSxK2s+9TnwCqzuRNOveZ kZIA== 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:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=4qbBMmffOr6qjUWGm6yd+EDK0Rv4Qeoj/k6Yhj4D74o=; b=rNXTlPt1N9trKc163H9bwxgwJTunEBvM2o8ukKZerYasVCs9h8iPfsltbgLMRK1AQw Fxq5cC6pl4JD1Qq4DN1GS3LBYwU44qQkDYNrjHAVEgVFVbUwRj6WLpSRY1SmUI6nSUtS cqE1d9sCBN4XgZoM1+dKvnpe2M7REjCqifNiAPg1Xb/myHnBqbHt3Iea3q+D90V1B1TQ 16vrOPqsVX8Gb8KvV9pAVFBmo68Xem+Ay0toRmcLZZIHkJSXbjBvvduPD5mZlA+Kks20 g2k2K3jquuvOV0iC2EfqWk36Mnhcmiz5f4/N5FVqiqiLvITv6wYVmyfjzq6jxRYOLali ec9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ijNw0vWF; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v26-v6si8793280pge.323.2018.06.29.14.16.34; Fri, 29 Jun 2018 14:16:48 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ijNw0vWF; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935822AbeF2UT7 (ORCPT + 99 others); Fri, 29 Jun 2018 16:19:59 -0400 Received: from mail-ua0-f195.google.com ([209.85.217.195]:36104 "EHLO mail-ua0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755478AbeF2UT5 (ORCPT ); Fri, 29 Jun 2018 16:19:57 -0400 Received: by mail-ua0-f195.google.com with SMTP id y8-v6so6558398uan.3; Fri, 29 Jun 2018 13:19:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=4qbBMmffOr6qjUWGm6yd+EDK0Rv4Qeoj/k6Yhj4D74o=; b=ijNw0vWF8j6TaBL2vyq6LAQ1bpPH+gn42WH0wSyB0NuaTRH+rqTrfnIlGibe+2tWxI nDikYRhoJFrQf0reAWUh+T6vEpAinrBf+3TXL8Kz2e5OXR7SX+pUZgei0csKZtUMIJgM Um+PTg9I0dekZxyFgQXGIua3OtOEEAB1reCz5BGocmdVa/k5ViycIT2YYkWYDlO0p5X7 X+4UCnxnVQqpTqyvlE0+HNjinRCICLC8b4roXbQ3E7e7USCM/n29+AZe5CIFHjT5Vgml 9kjDR9w8TL2xT+xhC/yERgEJFv/z6JECl3RLgBBvzOQEIDq27IgTQ6Xz8OoTGgQ8Hy5T Y10Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=4qbBMmffOr6qjUWGm6yd+EDK0Rv4Qeoj/k6Yhj4D74o=; b=gYrpsvICeLpmAgrfWNdXjNOpT7DawT0Wi1PSMP75KMfX5OKOXSR+84cIzZ9vVWqvuW elwdYDNUOWCnrFSx+pycWKePmcf/GF5m4isVoCKsSMXAGbTlLQV/FNvTUAOpZJ0Bc445 ioXJ/EQCWJmnKdI1IXckF/8AlSUpQGDjwJlh1lCoBLSoBIglZYG5VIoJHBOoOi/5fglw EJHGr9yOytnQ0F5gZiNJ4Whp9J1VWEveBsZQiLn5pP5bpZ1Z4qzyFE+Dr+GvDeZUJnip WNCiShCVdQ1HD0Z0kZc5KoSOO8Y4YsF2zJuzKl9OtiQYvO1vC/x2FgR+SbNWTBAJHkND 169g== X-Gm-Message-State: APt69E0wBtTOSCyytY+hLfQ0XQdfWt3H6r23EbsyjGTGj5+dio3WkI/I T7TE/4gRWsEOxdzTlsIqE7K4b29zGBIFEV33QYU= X-Received: by 2002:ab0:1a23:: with SMTP id a35-v6mr10201773uai.47.1530303596235; Fri, 29 Jun 2018 13:19:56 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a67:8b02:0:0:0:0:0 with HTTP; Fri, 29 Jun 2018 13:19:55 -0700 (PDT) In-Reply-To: References: From: Andy Shevchenko Date: Fri, 29 Jun 2018 23:19:55 +0300 Message-ID: Subject: Re: [PATCH 0/3] IIO: st_sensors_i2c: improve device enumeration To: Nikolaus Voss Cc: Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , Lorenzo Bianconi , Linus Walleij , Xiongfeng Wang , linux-iio@vger.kernel.org, Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 29, 2018 at 1:30 PM, Nikolaus Voss wrote: > 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. > I'm not sure I understand how ->probe_new() is supposed to work against i2c_id_table, but I don't care for legacy platform data anyway. What I would like to point to is device_get_match_data() API which should simplify / unify the case how you get driver data. > 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 > -- With Best Regards, Andy Shevchenko