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=-7.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED 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 56EA8C04AAF for ; Mon, 20 May 2019 06:06:57 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2952120815 for ; Mon, 20 May 2019 06:06:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ccSOXDue" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2952120815 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=mediatek.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Date:To:From:Subject:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=zP97BSUz3UELH9jj6XNd5sPcttfBwCQOZMByMNZVJ90=; b=ccSOXDuepcjNgG DOCIibPwe4rveWEw7GYLb8g5cMxQhyTfUNe7VtZfrY7XdKeYntPYXeK/8OBbAHzdBeY6cmxENlW0L 1WHajqv3ggKnWC98mNPU866WxAv/Uw2yFZhHhns7njxeEweIy6yDR1MHnkGNVrc86BgBccBIF6X/c pikJR0JwPlcul9avVhO4vGlL5JSh8PbXc1auCTz3P8ciGgPslGhK8egoETJMHilael/yhSTecla34 UbfJfAUD180c0GWezoRh6XxxrNgreus5Rnqa/yxHkIgkAHNWCvP3zAlYXzY9zkCMFHNfiuji6MroG YlQ//4cXSNFL2soWD1Uw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hSbRi-0005FD-3E; Mon, 20 May 2019 06:06:50 +0000 Received: from mailgw02.mediatek.com ([216.200.240.185]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hSbRe-00058S-Kv; Mon, 20 May 2019 06:06:47 +0000 X-UUID: b6ea6b9fce964c7cac7254bb2ba854f8-20190519 X-UUID: b6ea6b9fce964c7cac7254bb2ba854f8-20190519 Received: from mtkcas68.mediatek.inc [(172.29.94.19)] by mailgw02.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLS) with ESMTP id 46756079; Sun, 19 May 2019 22:06:42 -0800 Received: from mtkmbs03n2.mediatek.inc (172.21.101.182) by MTKMBS62N1.mediatek.inc (172.29.193.41) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Sun, 19 May 2019 23:06:40 -0700 Received: from mtkcas09.mediatek.inc (172.21.101.178) by mtkmbs03n2.mediatek.inc (172.21.101.182) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Mon, 20 May 2019 14:06:38 +0800 Received: from [172.21.77.33] (172.21.77.33) by mtkcas09.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Mon, 20 May 2019 14:06:38 +0800 Message-ID: <1558332398.11080.9.camel@mtkswgap22> Subject: Re: [PATCH 4/4] iio: auxadc: mediatek: change to subsys_initcall From: Chun-Hung Wu To: Jonathan Cameron Date: Mon, 20 May 2019 14:06:38 +0800 In-Reply-To: <20190518113643.53a42976@archlinux> References: <1557994247-16739-1-git-send-email-chun-hung.wu@mediatek.com> <1557994247-16739-5-git-send-email-chun-hung.wu@mediatek.com> <20190518113643.53a42976@archlinux> X-Mailer: Evolution 3.2.3-0ubuntu6 MIME-Version: 1.0 X-TM-SNTS-SMTP: 2F0B7CBF20F89F7C6C59579E9C4CCAF43409E6EB9A5EC6F37009CE4AC58C707A2000:8 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190519_230646_690938_ADBDF70B X-CRM114-Status: GOOD ( 14.67 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, Lars-Peter Clausen , wsd_upstream@mediatek.com, linux-iio@vger.kernel.org, kuohong.wang@mediatek.com, linux-kernel@vger.kernel.org, Rob Herring , linux-mediatek@lists.infradead.org, peter.wang@mediatek.com, Peter Meerwald-Stadler , Hartmut Knaack , Matthias Brugger , jg_poxu@mediatek.com, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Jonathan, On Sat, 2019-05-18 at 11:36 +0100, Jonathan Cameron wrote: > On Thu, 16 May 2019 16:10:47 +0800 > Chun-Hung Wu wrote: > > > Move auxadc platform_driver_register() from module_init > > to subsys_initcall because auxadc user drivers > > are all moudle drivers, need to gurantee > > auxadc driver ready before module_init. > > > Is it not possible to make them use deferred handling to come > back later if this isn't yet available? > > subsys_initcall often ends up being a more fragile approach. Agreed, I will ask auxadc driver users to add deferred handling instead of moving auxadc platform_driver_register() from module_init to subsys_initcall. Thanks, Chun-hung > > Thanks, > > Jonathan > > > Signed-off-by: Chun-Hung Wu > > --- > > drivers/iio/adc/mt6577_auxadc.c | 14 +++++++++++++- > > 1 file changed, 13 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/iio/adc/mt6577_auxadc.c b/drivers/iio/adc/mt6577_auxadc.c > > index 58d7cb2..cb8e3dd 100644 > > --- a/drivers/iio/adc/mt6577_auxadc.c > > +++ b/drivers/iio/adc/mt6577_auxadc.c > > @@ -350,7 +350,19 @@ static int mt6577_auxadc_remove(struct platform_device *pdev) > > .probe = mt6577_auxadc_probe, > > .remove = mt6577_auxadc_remove, > > }; > > -module_platform_driver(mt6577_auxadc_driver); > > + > > +static int __init mt6577_auxadc_init(void) > > +{ > > + return platform_driver_register(&mt6577_auxadc_driver); > > +} > > + > > +static void __exit mt6577_auxadc_exit(void) > > +{ > > + platform_driver_unregister(&mt6577_auxadc_driver); > > +} > > + > > +subsys_initcall(mt6577_auxadc_init); > > +module_exit(mt6577_auxadc_exit); > > > > MODULE_AUTHOR("Zhiyong Tao "); > > MODULE_DESCRIPTION("MTK AUXADC Device Driver"); > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel