From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6E8E9C6778C for ; Tue, 3 Jul 2018 07:04:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1868E24899 for ; Tue, 3 Jul 2018 07:04:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1868E24899 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=loewensteinmedical.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753663AbeGCHDz (ORCPT ); Tue, 3 Jul 2018 03:03:55 -0400 Received: from mail.steuer-voss.de ([85.183.69.95]:55098 "EHLO mail.steuer-voss.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752719AbeGCHDx (ORCPT ); Tue, 3 Jul 2018 03:03:53 -0400 X-Virus-Scanned: Debian amavisd-new at mail.steuer-voss.de Received: by mail.steuer-voss.de (Postfix, from userid 1000) id 4E3D241C51; Tue, 3 Jul 2018 09:03:48 +0200 (CEST) Message-Id: From: Nikolaus Voss Date: Tue, 3 Jul 2018 08:34:20 +0200 Subject: [PATCH v2 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 , Andy Shevchenko , nv@vosn.de 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. 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 | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) -- 2.17.1