Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp695391imm; Wed, 4 Jul 2018 04:28:33 -0700 (PDT) X-Google-Smtp-Source: AAOMgpenaSAY9sdHVwH95MMA2X+zLlGCNWEfLJEFmbBWtRErnqEFJzw1/+FJjbHaZhFOwOLPvMEM X-Received: by 2002:a63:220d:: with SMTP id i13-v6mr1617593pgi.212.1530703713493; Wed, 04 Jul 2018 04:28:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530703713; cv=none; d=google.com; s=arc-20160816; b=p0MUKejGbmjzcOSLMmXRlqoCvxJmx46hpdRftN8KIuQtLlcyPVREeZ1UojS8j7uLKG QGGlGa36AgO/g+ywEBmqreKecivEqq+kVlBynDyFUqDKAtfTKhXuQsl0uTfG/QcZsgoe cHXUG2W+GUE5QRwXvtS7YWa7cInkN5j+OB9ZGLFL3k3XhKVyT2ffbxtUae9I3Oi3fBvf 2WSULnRF7tPX+EhiK2jplpMSxZxR1KHZfHbDH6rmhHuIoRA4YPtzwn6yMOd4caZhtKsu dAH4Q63WWyvbFIHj2WaR0YbBXFTEFUQ/ofykqSazgMTnyhYcwvR2TaGoM0A6a12wJldz nWPQ== 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=ZN4cdtwiCKYUIxSI2oO8Rjv2EvNVl0Tb8mnFdtXeuxk=; b=XolEhr6KnWcDhhO6pIU4AT2Du5A0cWOov0pJ+Nu+ikPIJBJaC5xQp3yoWD347PA0Xf WDCamAXpYodcGFb9+0jhnkouzTBaJFA9Vp10CkO2s0FtsAGJ6OVoTqK/AR/rTaNWcPqo NsUuEtGAY1VRC38stXOJYeaYqPwroDaT63aWF3r13UBb9+CfnllZeoGCaRRPFB+LjOhq TTz/ie4+8OJRad55LDemGQ+fdr7d7hFteGRRrm+qtKAk64o1z3x76PSjWGCjf9WO9BpS uI8BxdP/TTfiTwq2q85enDx3YUti8FakeL5YYa3Kj2xcSQjErQVkbE8YiUEl0wPvUEY/ SJow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@dowhile0-org.20150623.gappssmtp.com header.s=20150623 header.b=zhPO6C5R; 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 w4-v6si2976119pgr.549.2018.07.04.04.28.18; Wed, 04 Jul 2018 04:28:33 -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=@dowhile0-org.20150623.gappssmtp.com header.s=20150623 header.b=zhPO6C5R; 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 S933628AbeGDL0V (ORCPT + 99 others); Wed, 4 Jul 2018 07:26:21 -0400 Received: from mail-it0-f68.google.com ([209.85.214.68]:38856 "EHLO mail-it0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932594AbeGDL0T (ORCPT ); Wed, 4 Jul 2018 07:26:19 -0400 Received: by mail-it0-f68.google.com with SMTP id v83-v6so7567760itc.3 for ; Wed, 04 Jul 2018 04:26:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dowhile0-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=ZN4cdtwiCKYUIxSI2oO8Rjv2EvNVl0Tb8mnFdtXeuxk=; b=zhPO6C5RJ4R7vk32QjiQxGaiCU2uyqcj0Q9B5+TPBmWNI/ZypAFgCEAKxeTWvU0gsW N9cBxlKRrvZTwb7ZALQFETYDgLaloPjJlafItawQMjNZ13Tk62YXl0UkL1rYk5PwNlmK 5BRJ/Ln5L82C3UHhq85YjETjzj8C9UUlVpgjmwOUts+aiS7QFYm/AwAvr1qExnyB6wTp Qqam46b93cOkDsVPwDVrG9AfjE+Y+Ql7RmKB46em9MTkP1yWpyzT3QS+4g8g0KUvNwsO aeuc+L2+gWTtT+lUZmir/gXQ2bmJQxNZnuklvpx3b87aHqAotqsuR8qmUsJ5J0ZvFZGA 82Zw== 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=ZN4cdtwiCKYUIxSI2oO8Rjv2EvNVl0Tb8mnFdtXeuxk=; b=iCtMifRXr3shDy0snuGz4ldCi/CW8x6Dp8cb5DyvSCUwz5EWXiGlYm0GUEW6391nCS ZgqSrW6cHKEfhx6GlmNFlaKAPoAZfJBVCqMkBEhB2mpV2YydnSB9w6cr+k/ZmLFOXiZP msD09g+dlaleAROaS4GXiQpVT1/Wsf+C3FNXxmq72B3QqbRpg0/3dXxgm3v7aByfvIKW xsDHT73RVVfDzYTNOt1VkfM39DIzxhh9CyQkgGFvylhZ3w2Ad9en9r7DzxpLyTWJCuh5 bpcl2CDpowl5K9WEAMQSv5dGsLzBfrohKfxjLCevC+hTitDsdQh5Djl/ZQeNKuykvBZr ot6g== X-Gm-Message-State: APt69E1FLWPrsSfvufpqrcUF8WerQMQW4hlbVpbDLcUjIJ8jcHvO9tF3 T4UyBLnTwqL9vks6qLeHkoP9o6yPUFJSiLXvvAhdXA== X-Received: by 2002:a24:1dd6:: with SMTP id 205-v6mr1393700itj.132.1530703579233; Wed, 04 Jul 2018 04:26:19 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a4f:f017:0:0:0:0:0 with HTTP; Wed, 4 Jul 2018 04:26:18 -0700 (PDT) X-Originating-IP: [195.166.127.210] In-Reply-To: References: <82c6f53cfa03f9bc7c0adfc423ae65fc986a1d25.1530599660.git.nikolaus.voss@loewensteinmedical.de> <10258a21-db42-2c4e-91d6-e9227e11f53b@redhat.com> From: Javier Martinez Canillas Date: Wed, 4 Jul 2018 13:26:18 +0200 Message-ID: Subject: Re: [PATCH v2 2/2] IIO: st_accel_i2c.c: Use probe_new() instead of probe() To: Nikolaus Voss Cc: Javier Martinez Canillas , Andy Shevchenko , Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , Lorenzo Bianconi , Linus Walleij , Xiongfeng Wang , linux-iio , Linux Kernel Mailing List , nv@vosn.de 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 Hi Nikolaus, On Wed, Jul 4, 2018 at 1:15 PM, Nikolaus Voss wrote: > On Wed, 4 Jul 2018, Javier Martinez Canillas wrote: [snip] >> I think Nikolaus is correct, assuming that the driver can be used on >> legacy >> platforms that register the I2C devices using board files / platform data. >> In that case you still need a I2C device ID table for (a) and (c) as he >> said. >> >> I don't buy on (b) though, that's a bug in my opinion. If you register an >> I2C >> device via DT then you must have a OF device ID entry that matches the >> device >> and the same for ACPI. You can't rely on the I2C device table to do the >> match. > > > Ok, in my opinion it is an elegant way of not bloating the driver when no > explicit handling (e.g. reading DT properties) is needed. Just adding an > of_device_id doesn't change any driver functionality then but only maps to > an already existing i2c_table_id. > I disagree, in the case of OF for example a compatible string is composed of both a vendor a device, the complete tuple is what should be matched. But with the fallback, only the device portion would be used so both and will match against the i2c device with id "bar". It may or may not be correct but the vendor portion is very important to disambiguate. >> >> I would also remove the struct i2c_device_id .driver_data fields from the >> I2C >> device ID table, since are not used and just makes reading the code >> confusing >> (only the struct i2c_device_id .name is used as far as I can see). > > > Valid point, thanks. I will change that. > >> >>> Javier, just a summary of the above. Nikolaus switched one driver to >>> use ->probe_new() hook and left i2c ID table at the same time. >>> My understanding that this table is not anymore in use. >>> >>> But I have to admit I didn't see entire picture of this. Can you shed a >>> light? >>> >> >> So to shed some light, in the past even {OF,ACPI}-only drivers needed an >> I2C ID >> table because: 1) the .probe callback had a struct i2c_device_id * >> parameter >> and 2) the I2C core always reported a modalias of the form i2c: even >> for >> devices registered via OF. > > > It could have been a null pointer and device driver binding (and > auto-loading) done just via driver.name. > I'm not sure I understood this comment. > Niko > Best regards, Javier