Received: by 10.223.176.5 with SMTP id f5csp645315wra; Sat, 3 Feb 2018 07:14:54 -0800 (PST) X-Google-Smtp-Source: AH8x225anuFXYgSpwE2mpkLcPKut0BODF5mPIzS8FeahJymlTp97XKdRjVnvgcUXOy+NjEoaZqBU X-Received: by 10.99.128.73 with SMTP id j70mr1748531pgd.37.1517670894357; Sat, 03 Feb 2018 07:14:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517670894; cv=none; d=google.com; s=arc-20160816; b=d4n8VXvQ7ol/jAz/swWT+f8LQgumNW5wJ+IIPVEPfcEgqxT5vAD0p+SaYPmPpGihbe sl48OgxXp9xRE+YRLSbuOMbaqrINNE1uFb8pbcpfNvbRA8B1fusJVntNx4aM6XTLmDoG JJnqh3fh7CHItc3UDKV/KJsgrqKzkxyhfxnzD5go242sjb1k6bvjgwrzK1Z14U1wiUan QtaB8InRcdE2GjiDwXkNuLdLL5s3pw7hvX7IbA73v2HatXbGiWKs0fCaEaCe66AfnunT 9KvuLRP/jQF6KIhdaXS7w12aJT+Mou3+kBWNyh4PHzcna2XhqKn/bqC6734aUrNrJSnz WlPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=Mj/rioFwCCY7XsqHwzcvWtvGd3K9V8SkI/Fj1JQYzz0=; b=AXbYTpfJY5+3ULSwFR8kPngf0Unxfpg7z4tfb6KC+4afSV/H1Ki9aVRInJ5gdzdArS 9TgILWBgnXhS8eX0y4ckvohXbrm9n+wKC8zYwONwOT0jSwNmJwolGRaLc3kk6uP8+ICZ zZXrg4C+XL2HUPpMPfqIjA4T36cMYMc2EqaC4lsYwOqwifkslIvZTLp1WIkko31z5UzY 3nqJeVn2inzpWvMOEFPeBaRhXnP7/IPjPOcycyExPGXA6TOGQzCc7U/RoQA4xpiC8FRq ezinWYMzGi4g8KfixE3pftPOqDGLZ2rNiBp3Y3GEY75DKzb1S2dhEEhqKzecInaViHBm e1tw== 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 p85si3813463pfa.20.2018.02.03.07.14.39; Sat, 03 Feb 2018 07:14:54 -0800 (PST) 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 S1752543AbeBCPMA (ORCPT + 99 others); Sat, 3 Feb 2018 10:12:00 -0500 Received: from 178.115.242.59.static.drei.at ([178.115.242.59]:57009 "EHLO mail.osadl.at" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1752039AbeBCPLx (ORCPT ); Sat, 3 Feb 2018 10:11:53 -0500 Received: by mail.osadl.at (Postfix, from userid 1001) id 86E905C1504; Sat, 3 Feb 2018 15:11:25 +0000 (UTC) Date: Sat, 3 Feb 2018 15:11:25 +0000 From: Nicholas Mc Guire To: Wolfram Sang Cc: Andy Shevchenko , Nicholas Mc Guire , Jonathan Corbet , linux-i2c , Linux Documentation List , Linux Kernel Mailing List Subject: Re: [PATCH] Documentation: i2c: drop unnecessary .owner field in examples Message-ID: <20180203151125.GA17486@osadl.at> References: <1516018126-16119-1-git-send-email-hofrat@osadl.org> <20180115202847.77s42fgc2zsdnc6s@ninjato> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180115202847.77s42fgc2zsdnc6s@ninjato> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 15, 2018 at 09:28:47PM +0100, Wolfram Sang wrote: > On Mon, Jan 15, 2018 at 10:24:52PM +0200, Andy Shevchenko wrote: > > On Mon, Jan 15, 2018 at 2:08 PM, Nicholas Mc Guire wrote: > > > From: Nicholas Mc Guire > > > > > > Currently there are a few drivers that still set the .owner > > > in the i2c_driver structure - all of which are reported by > > > coccinelle (scripts/coccinelle/api/platform_no_drv_owner.cocci) > > > and there are no cases that set the .onwer and do not call any > > > of the functions that set the .owner field anyway in any of the > > > drivers (checked by a modified coccinelle script based on the > > > above) so it seems that the examples are no longer valid and > > > .owner = THIS_MODULE, can be removed here. > > > > > > While at it an obvious typo (new new) was also fixed. > > > > AFAIU It is right only in case when someone does this, e.g. > > module_i2c_driver() macro. Otherwise the field is pretty valid and > > must be filled. > > It gets filled with i2c_add_driver. module_i2c_driver uses > i2c_add_driver. I was about to suggest to keep the field in the old > driver and describe that it can be removed when using one of > i2c_add_driver or module_i2c_driver. > > But then I realised that the kernel tree does not have any such old > drivers anymore and I couldn't even find out-of-tree code via some > search engines (I tried looking for "I2C_CLIENT_INSMOD"). > > I consider this obsolete and irrelevant these days. It might be good to > simply remove it to not confuse users. > Not sure what the status of this is now - but I would want to clean up some of the coccinelle findings - as a pre-requisite it would make sense to either drop the examples inclusion of .owner = THIS_MODULE or add a note in the documentation making clear that this is only needed in case where the appropriate module initialization helpers are not used. Is there any good reason *not* to use these initialization helpers when upgrading a driver ? If not (and I could not find one) then it might simply be the right way to recommend using the initialization helpers and drop the .owner = THIS_MODULE from the examples. Anyway - cleaning up coccinelle findings would seem futile if the documentation may be the cause. thx! hofrat