From patchwork Tue Aug 20 08:32:28 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhangfei Gao X-Patchwork-Id: 2846912 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 753D3BF546 for ; Tue, 20 Aug 2013 08:33:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 516A120488 for ; Tue, 20 Aug 2013 08:33: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 896B620466 for ; Tue, 20 Aug 2013 08:33:28 +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 1VBhNL-00065Y-7l; Tue, 20 Aug 2013 08:33:15 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VBhNI-0005XA-W8; Tue, 20 Aug 2013 08:33:13 +0000 Received: from mail-pa0-f54.google.com ([209.85.220.54]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VBhNF-0005V8-TU for linux-arm-kernel@lists.infradead.org; Tue, 20 Aug 2013 08:33:11 +0000 Received: by mail-pa0-f54.google.com with SMTP id kx10so434171pab.13 for ; Tue, 20 Aug 2013 01:32:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=ZSzzmJQ1CuIEINqMP1lHL/l0m4vhOSUc6gSA44dEgNU=; b=TOvj2ZT4JYqXOX5YE6IElPeOc5OQg7Plkk0DPSQYcThtICaw/JoSQ3qxdtgipUPvwe wdNJywfUtGKXwv8r1i6luVwhZQQpac1k9q+NxIl0V2AdJZqDqDbmbcEdvAxmfBgnU1Q+ Xy+xLfLIGIn1pFy1DxX2kSbht4FjJdBafJNUNp6kS3kPagg03E1FIpB4VefDONLoeMbq boaOO6A3phuekzdrZhbW9LUfIWOknLS4dKDMxpaW7cMSCCqhlnSzJhm7fvQo8aCcgrrw 4QH8HflKHUlSWbmlB9PhrZfgA9f4ahwo7pR/7a1gGx/8J2ej4MfHLCIestxQYnY8VVhl bgVA== X-Gm-Message-State: ALoCoQkdsz9hK+6qoIzyns0Gwdf1/oAGxiHDMA8I9itCCDqfy06TRfNEFgEBLNvXO32+zkO9Stvl X-Received: by 10.68.238.104 with SMTP id vj8mr406051pbc.149.1376987564434; Tue, 20 Aug 2013 01:32:44 -0700 (PDT) Received: from localhost.localdomain ([114.97.107.100]) by mx.google.com with ESMTPSA id jf4sm723707pbb.19.1969.12.31.16.00.00 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 20 Aug 2013 01:32:43 -0700 (PDT) From: Zhangfei Gao To: Wolfram Sang , Baruch Siach Subject: [PATCH RESEND] i2c: designware: use module_platform_driver Date: Tue, 20 Aug 2013 16:32:28 +0800 Message-Id: <1376987548-12366-1-git-send-email-zhangfei.gao@linaro.org> X-Mailer: git-send-email 1.7.9.5 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130820_043310_040484_2AE7CB95 X-CRM114-Status: GOOD ( 10.41 ) 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=-7.0 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");