Received: by 2002:ac0:a591:0:0:0:0:0 with SMTP id m17-v6csp418199imm; Thu, 5 Jul 2018 02:36:13 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfJ6+yK+8EJuFBXXgxwplaM+AVet4MUwOexR1EE35KeLZEQCTwWOA5Uh78RitCX2SSshaMk X-Received: by 2002:a17:902:bcc3:: with SMTP id o3-v6mr5366844pls.336.1530783372994; Thu, 05 Jul 2018 02:36:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530783372; cv=none; d=google.com; s=arc-20160816; b=vISgKxc3Twrtz8EF8fwvDJfCJzgtZ3QVJIBnp1Di144skFE2byrQu8F9HfvhuutKbN 5gwiadUgPy9g5JBL2yCdCuL9Hl+Tf7mphbzxRtQoyXxRyBLsLroYOQ7GGBO0iN7yqRyX XMQv5i1qTf0TAaYIK4t0OvXZeFW57tMV2dgPDkAVbVPt51//wJR6k1rXMQ32AWHQK4hx BlD04YuqINHzgneCazGILsWgjgYkimtNysnDBS+ZVgi+yLEFM1k8be2RKGpWpc4KuqNc HXmXvzIGcAoXHv0rB2CQIdfoojLwykhWUc+FiNtJXLBCfn0CTWwUxTjI7niS7chgdJvQ deQg== 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=7gCZ+Jykf8m5tSwflRAnEyFNUBgJH6nD//5ljXtBAD8=; b=F/IRNwrSFHi7lGj+sDX/bXjouvffWpGQabdRIqQy2/q4xWrDM32kURlOgCy78cyYR9 imcjv3A0dBn5aKHUAgpDrs987BcpLgECARdVdM0PvESA0iirfLZabFoEBARaNVWjtiOa wE8kL8Ir/YISY2YLp3gtUg//9Ch0fYUadoAXu0JpRd1gm0/i8EMpPwQmJ9LSm5oYXI7k CvkOX8gVs7ZcG7hsPXIRVRUZ8ldHyCMZYX7GIiP9NL9K0FRi9X5iSnOeuTtdUQcUIGQ4 jewI3TfgG4pHrNQ/QZNwAdJHbqWfgh9O54cRGbsHKD/d3ri7dWy/P8+fSS8OR+MPckwy B74g== 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 j91-v6si5528121pld.402.2018.07.05.02.35.58; Thu, 05 Jul 2018 02:36:12 -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 S1753389AbeGEJeU (ORCPT + 99 others); Thu, 5 Jul 2018 05:34:20 -0400 Received: from mail.steuer-voss.de ([85.183.69.95]:59072 "EHLO mail.steuer-voss.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753134AbeGEJeS (ORCPT ); Thu, 5 Jul 2018 05:34:18 -0400 X-Virus-Scanned: Debian amavisd-new at mail.steuer-voss.de Received: by mail.steuer-voss.de (Postfix, from userid 1000) id 94B7F43EB7; Thu, 5 Jul 2018 11:34:14 +0200 (CEST) Message-Id: From: Nikolaus Voss Date: Thu, 5 Jul 2018 11:22:40 +0200 Subject: [PATCH v4 0/2] IIO: st_sensors_i2c: improve device enumeration To: Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , Lorenzo Bianconi , Linus Walleij , Xiongfeng Wang , nv@vosn.de, Javier Martinez Canillas 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. Use device_get_match_data API to get the right driver data. acpi_device_get_match_data() currently doesn't return DT compatible matches. A separate patch is submitted to fix this. v4: - rebased onto linux-next - add Andy Shevchenko as reviewer v3: - remove unused i2c_device_id .driver_data fields as suggested by Javier Martinez Canillas. v2: - use device_get_match_data API as suggested by Andy Shevchenko - removed syncing DT/I2C table names as Jonathan Cameron pointed out this would be an ABI change - converting from probe() to probe_new() is moved into a separate patch (as suggested by Jonathan Cameron) Nikolaus Voss (2): IIO: st_accel_i2c.c: Simplify access to driver data IIO: st_accel_i2c.c: Use probe_new() instead of probe() drivers/iio/accel/st_accel_i2c.c | 64 ++++++++++++++------------------ 1 file changed, 27 insertions(+), 37 deletions(-) -- 2.17.1