From patchwork Fri Jul 26 13:22:17 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhangfei Gao X-Patchwork-Id: 2834163 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 269529F243 for ; Fri, 26 Jul 2013 13:26:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1136920204 for ; Fri, 26 Jul 2013 13:26:31 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 206CA20203 for ; Fri, 26 Jul 2013 13:26:29 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1V2i2M-0006ZK-59; Fri, 26 Jul 2013 13:26:26 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1V2i2K-0002pE-1N; Fri, 26 Jul 2013 13:26:24 +0000 Received: from mail-pa0-f53.google.com ([209.85.220.53]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1V2i14-0002j4-8U for linux-arm-kernel@lists.infradead.org; Fri, 26 Jul 2013 13:25:07 +0000 Received: by mail-pa0-f53.google.com with SMTP id lb1so3279100pab.12 for ; Fri, 26 Jul 2013 06:24:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=ZSzzmJQ1CuIEINqMP1lHL/l0m4vhOSUc6gSA44dEgNU=; b=Pazuk87nE97tPkVNY099sujLvHTL0qiz74ALabE+gRHOzZ1syOFPB3jL5XUT2wXdx1 uZuO5sQpzD+2OUc+pQC5O0McfwWjHdXfy+XtNpYFkq7Jbkdr11S0rSncMTM7BJUvCOIZ ZXnfBODGvFag2440seoYREV/CiVOFm9DqMe9s/nflbrebjnIdxAV8xX8QbziKzBUwh97 4omiFlRWWsgNOjq2QZKxSQru/dDyyB5YuRTAn2Qw8xtloHbjCF8jlpradI9Y6+6LmGZ0 QweUP1k65HnKFzw1EFN3wWXBwTnFnK0wfGKPJ5dlHcI9a/tI7qD7GbBG0FhTsPk1ZHeb 1GIQ== X-Received: by 10.66.216.161 with SMTP id or1mr6129748pac.41.1374845084795; Fri, 26 Jul 2013 06:24:44 -0700 (PDT) Received: from localhost.localdomain ([114.97.97.190]) by mx.google.com with ESMTPSA id x8sm60092056pbb.39.2013.07.26.06.23.18 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 26 Jul 2013 06:24:44 -0700 (PDT) From: Zhangfei Gao To: Wolfram Sang , Baruch Siach Subject: [PATCH v4 1/2] i2c: designware: use module_platform_driver Date: Fri, 26 Jul 2013 21:22:17 +0800 Message-Id: <1374844938-25505-2-git-send-email-zhangfei.gao@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1374844938-25505-1-git-send-email-zhangfei.gao@linaro.org> References: <1374844938-25505-1-git-send-email-zhangfei.gao@linaro.org> X-Gm-Message-State: ALoCoQk78dJV9wnv6Mk60kyxxz9cqvtWaFmiVRZcpVZszIlciNFw99J9WQrX+EqaHO77eT3H3m9r X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130726_092506_463607_F1891DF1 X-CRM114-Status: GOOD ( 11.18 ) X-Spam-Score: -2.6 (--) Cc: Zhangfei Gao , linux-i2c@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.7 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Instead of use platform_driver_probe, use module_platform_driver To support deferred probing Also subsys_initcall may too early to auto set pinctl Signed-off-by: Zhangfei Gao Acked-by: Baruch Siach --- drivers/i2c/busses/i2c-designware-platdrv.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c index 4c5fada..36ceebc 100644 --- a/drivers/i2c/busses/i2c-designware-platdrv.c +++ b/drivers/i2c/busses/i2c-designware-platdrv.c @@ -236,6 +236,7 @@ static SIMPLE_DEV_PM_OPS(dw_i2c_dev_pm_ops, dw_i2c_suspend, dw_i2c_resume); MODULE_ALIAS("platform:i2c_designware"); static struct platform_driver dw_i2c_driver = { + .probe = dw_i2c_probe, .remove = dw_i2c_remove, .driver = { .name = "i2c_designware", @@ -245,18 +246,7 @@ static struct platform_driver dw_i2c_driver = { .pm = &dw_i2c_dev_pm_ops, }, }; - -static int __init dw_i2c_init_driver(void) -{ - return platform_driver_probe(&dw_i2c_driver, dw_i2c_probe); -} -subsys_initcall(dw_i2c_init_driver); - -static void __exit dw_i2c_exit_driver(void) -{ - platform_driver_unregister(&dw_i2c_driver); -} -module_exit(dw_i2c_exit_driver); +module_platform_driver(dw_i2c_driver); MODULE_AUTHOR("Baruch Siach "); MODULE_DESCRIPTION("Synopsys DesignWare I2C bus adapter");