Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp580352imm; Wed, 4 Jul 2018 02:18:20 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcJZ/ayN6A9wx7oJwOouYzb7xRI5wtGdCDKVNHqf80pvLAKLOHgnocLS38G33jr8sxt2Bs9 X-Received: by 2002:a65:4b4a:: with SMTP id k10-v6mr1229255pgt.12.1530695900593; Wed, 04 Jul 2018 02:18:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530695900; cv=none; d=google.com; s=arc-20160816; b=U9h4TV8nH9xwVyp+WhLq8xVyya36/s1Lol27Io1Zv+Wqn4KeABX+yswFsft9A1geEe q4e1HliQ6wogB/puJVO4KyAOrzeGSPQNoN/bIie9uVF4gltIijRDobGmrsrYpbB5eKGU tcFEG8UMnrVCa/BA2b38B5YETaEd+3w51PohWOCIhTRriIb1jbxyHkfUGjApOsmn5XVZ 43r/csMIZQn5SH2QoQGA+i4V/NiZ5UPhxyNOKz6uqrqfR8sQ+n/LbKcRdNwWrrgpu8lT r2m8bBsjrYGzCPBUoxNPIyL31fetT1SnX8JWgn/uXkYi//KGw+9xsfpiNYBfOZKxH7HN Jxwg== 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=XRZLEx+pVO3Pg28ut2GyDmKa4DRYCv1pXbSDDMaSYME=; b=tyuPlW7WqDFg7hvk8GWc6CeNMxxyLDp4/Czf2DVRyDEQJRsZPWja7CaFGc8mzeQF4P qr0kI82PYPdZaVpWsTPN+2iDsfyfoIuYOjUP6BKPZ7MyBwZYIhSQ7/iZh0tmZ2tVat8F nQ4cNfQW/bJcerT3dQooaos2l0/7fTg7sk0OZ91DznlbjCpMX4eyvkhaU3xXqkp4J1pE GJwvQF3xzTiD9AF6bmI02u64lnuBUKJIMRj3azPzXnFlbJOhQiDYgsZ1RdePdWMvO1TC FXKb9WLpAgKBkx6H2PZp/QRaSVuTnIKlJefvQE23jL29kxVrfbMVcwr539lf3vjbwTSp iljw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=EHpKE5EZ; 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 e6-v6si3161227pls.419.2018.07.04.02.18.06; Wed, 04 Jul 2018 02:18:20 -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=EHpKE5EZ; 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 S934330AbeGDJQR (ORCPT + 99 others); Wed, 4 Jul 2018 05:16:17 -0400 Received: from mail-vk0-f67.google.com ([209.85.213.67]:36609 "EHLO mail-vk0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932479AbeGDJQN (ORCPT ); Wed, 4 Jul 2018 05:16:13 -0400 Received: by mail-vk0-f67.google.com with SMTP id y9-v6so2718082vky.3; Wed, 04 Jul 2018 02:16:13 -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=XRZLEx+pVO3Pg28ut2GyDmKa4DRYCv1pXbSDDMaSYME=; b=EHpKE5EZcdlsmwe822NToBuhKXQVEZqOIIIretlmpA4hkRIA3VIMoe9SUKY6RubP+r bniw6U5ly26PvqMSfHPNpQI3REWqBYlKg2WdUbnDxOf13q437oqIR8eoYQunZRvhCQD0 VSG6+I3dkWPxa0U8r4Ur7qRgn6D+QYtYuVfTq6byqfsy5wO628MxYKq8LFMMMlEzCCbm 81C0fDBCutOfEyTn6wmzdhOGnHqEaK9sk987zvcTZp9DI/JgOrxw0jaUKEVt7xxaUdgu lkDvTrv7uePsqDQxCMX2IKCbg6JQNkjfQbyAaNboUYjbmOPvs+qfi1WKM6pgXWqDtQtA vZ+Q== 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=XRZLEx+pVO3Pg28ut2GyDmKa4DRYCv1pXbSDDMaSYME=; b=d3RAKRciERDp4WYh6Ur3vJsfwdu6UeGhsRG/PtU/hyDRomS2xHSafzKl7370DWrCo7 rA74H5ldWx528EEM/a6U+YRE5I92kipsGfSCyAJ3q5/QnvrBKJmYX+abm84TAQRYXcQy YwqHNhvt5CoIl/2B5Vv2sX2kjR5FgyOh5huXjRfkZ6YN+aFwx0Kb+pS1Rn2ulNTzk04q X8q+JAlY3A46+dnXJj1Tq+osgC0m3ePmEh+CCToS6k8GvJDkVGLuYMQWQAX90gNsYoHR xlEULlqVWe0kxcxq6VV/CIg+wyUgW9q7etAXF+MIBQAmgI76cGWCLKZoGIMSB8DLSQuV KJng== X-Gm-Message-State: APt69E1yUz4hb4/UyZm2bFsI8DBAIrlEhHCoq6brQBzw4CvfQsHpTv4e sEHwAWQVJTYf7DVdFMRqwb3m4r89ZiEV4HmQVBE= X-Received: by 2002:a1f:6dc4:: with SMTP id i187-v6mr600599vkc.131.1530695773073; Wed, 04 Jul 2018 02:16:13 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a67:2149:0:0:0:0:0 with HTTP; Wed, 4 Jul 2018 02:16:12 -0700 (PDT) In-Reply-To: References: <82c6f53cfa03f9bc7c0adfc423ae65fc986a1d25.1530599660.git.nikolaus.voss@loewensteinmedical.de> From: Andy Shevchenko Date: Wed, 4 Jul 2018 12:16:12 +0300 Message-ID: Subject: Re: [PATCH v2 2/2] IIO: st_accel_i2c.c: Use probe_new() instead of probe() 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 , 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 On Wed, Jul 4, 2018 at 12:09 PM, Nikolaus Voss wrote: > On Wed, 4 Jul 2018, Andy Shevchenko wrote: >> >> On Wed, Jul 4, 2018 at 9:37 AM, Nikolaus Voss >> wrote: >>> >>> On Wed, 4 Jul 2018, Andy Shevchenko wrote: >>>> >>>> >>>> On Tue, Jul 3, 2018 at 9:06 AM, Nikolaus Voss >>>> wrote: >>>>> >>>>> >>>>> struct i2c_device_id argument of probe() is not used, so use >>>>> probe_new() >>>>> instead. >>>>> >>>> >>>> This makes... >>>> >>>>> MODULE_DEVICE_TABLE(i2c, st_accel_id_table); >>>> >>>> >>>> >>>> ...this table obsolete IIUC. At least that's what I did when switched >>>> to ->probe_new() in some drivers. >>>> >>>> If I'm mistaken (again? :-) ) I would hear from someone to point me >>>> how it can be used after a switch. >>> >>> >>> >>> It is still used by the i2c-core in i2c_device_match() if DT and ACPI >>> matching fails. >> >> >>> And it is used to create the corresponding modaliases for >>> driver loading. >> >> >> My question is "How?!" >> I don't really see any points to match against it after switching to >> ->probe_new(). >> >> Could you point me to the code path in i2c (or OF?) core for that? > > > As written above in i2c-core-base.c: i2c_device_match() -> > i2c_match_id(driver->id_table,... > > This is used for driver matching before probe() or probe_new() of the device > driver can be called. probe_new() actually is a function signature change > only. Okay, IIUC we got a match. What should we do with it? The table is not used in ->probe_new() (in i2c core), so, you can't say which line matched there. -- With Best Regards, Andy Shevchenko