From patchwork Mon Jun 10 05:02:54 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhangfei Gao X-Patchwork-Id: 17712 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f197.google.com (mail-qc0-f197.google.com [209.85.216.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3B10825DFB for ; Mon, 10 Jun 2013 05:03:15 +0000 (UTC) Received: by mail-qc0-f197.google.com with SMTP id u12sf1878796qcx.4 for ; Sun, 09 Jun 2013 22:03:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-beenthere:x-forwarded-to:x-forwarded-for :delivered-to:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe; bh=8ljUpzyLIbLO7lJmNSzb5BOK+NpeyWe0a+RduZ/sE64=; b=Jvd2uiabTMDpv0OjxLIXO4sTIhij2bGM8WSJfgkirL9a5ECfm0wZjfBFehNtjE5Cn+ LC53BMhaqB4y9PeugpIX26SH4mcl1p9aZr2C7tbK359OG2RUr/w4vbppXhDEhJV7IYr/ qYyloDu4Mc8+KOVlkVDg3bzHBduZ09C9RBF5RxYixOW2Ym4A5J64eWu/IO60mwnu/Nf8 GusGWzP13E1k27V4FtRCP2Z7ToUyEx5F1TKaN66WPcEl8oIsmciI469deCcbEIPKbmNg d1bIM3IDV4U89vIaT/H8PH8vT2QdtT9RhZTE7/NEJWPh98f1q945zGTO6EKwwNseBv3+ X/cQ== X-Received: by 10.236.42.116 with SMTP id i80mr5196590yhb.26.1370840594993; Sun, 09 Jun 2013 22:03:14 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.121.5 with SMTP id lg5ls2647034qeb.21.gmail; Sun, 09 Jun 2013 22:03:14 -0700 (PDT) X-Received: by 10.52.97.71 with SMTP id dy7mr3947929vdb.40.1370840594707; Sun, 09 Jun 2013 22:03:14 -0700 (PDT) Received: from mail-vc0-f180.google.com (mail-vc0-f180.google.com [209.85.220.180]) by mx.google.com with ESMTPS id ia10si4282978vdb.64.2013.06.09.22.03.14 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 09 Jun 2013 22:03:14 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.180 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.180; Received: by mail-vc0-f180.google.com with SMTP id gf11so2064472vcb.39 for ; Sun, 09 Jun 2013 22:03:14 -0700 (PDT) X-Received: by 10.58.106.77 with SMTP id gs13mr4671679veb.22.1370840594566; Sun, 09 Jun 2013 22:03:14 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.221.10.206 with SMTP id pb14csp55406vcb; Sun, 9 Jun 2013 22:03:13 -0700 (PDT) X-Received: by 10.66.102.97 with SMTP id fn1mr12483561pab.116.1370840593600; Sun, 09 Jun 2013 22:03:13 -0700 (PDT) Received: from mail-pb0-x22c.google.com (mail-pb0-x22c.google.com [2607:f8b0:400e:c01::22c]) by mx.google.com with ESMTPS id hb2si6259410pac.89.2013.06.09.22.03.13 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 09 Jun 2013 22:03:13 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400e:c01::22c is neither permitted nor denied by best guess record for domain of zhangfei.gao@linaro.org) client-ip=2607:f8b0:400e:c01::22c; Received: by mail-pb0-f44.google.com with SMTP id uo1so2087245pbc.3 for ; Sun, 09 Jun 2013 22:03:13 -0700 (PDT) X-Received: by 10.68.0.66 with SMTP id 2mr8531655pbc.15.1370840593161; Sun, 09 Jun 2013 22:03:13 -0700 (PDT) Received: from localhost.localdomain ([124.73.11.242]) by mx.google.com with ESMTPSA id eq4sm13955065pad.16.2013.06.09.22.03.08 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 09 Jun 2013 22:03:12 -0700 (PDT) From: Zhangfei Gao To: Wolfram Sang , Dirk Brandewie , baruch@tkos.co.il Cc: linux-arm-kernel@lists.infradead.org, devicetree-discuss@lists.ozlabs.org, Zhangfei Gao Subject: [PATCH v2 1/2] i2c: designware: use module_platform_driver Date: Mon, 10 Jun 2013 13:02:54 +0800 Message-Id: <1370840576-15651-2-git-send-email-zhangfei.gao@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1370840576-15651-1-git-send-email-zhangfei.gao@linaro.org> References: <1370840576-15651-1-git-send-email-zhangfei.gao@linaro.org> X-Gm-Message-State: ALoCoQl01h7dlOn8mb5dI4L8EHwA1YnOkVO7ClneHGN421LVcNgh8fk8DDm9UgUcqUHrUoplLSFy X-Original-Sender: zhangfei.gao@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.180 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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 CC: 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 35b70a1..41659c0 100644 --- a/drivers/i2c/busses/i2c-designware-platdrv.c +++ b/drivers/i2c/busses/i2c-designware-platdrv.c @@ -231,6 +231,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", @@ -240,18 +241,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");