From patchwork Mon Sep 22 07:24:35 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Zhong X-Patchwork-Id: 4945871 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 C5BC1BEEA5 for ; Mon, 22 Sep 2014 07:28:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 162B6201FA for ; Mon, 22 Sep 2014 07:28:41 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F096B20149 for ; Mon, 22 Sep 2014 07:28:39 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XVxzj-0006oL-S1; Mon, 22 Sep 2014 07:25:11 +0000 Received: from mail-pd0-f171.google.com ([209.85.192.171]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XVxzg-0005QL-5h; Mon, 22 Sep 2014 07:25:09 +0000 Received: by mail-pd0-f171.google.com with SMTP id y13so3880702pdi.30 for ; Mon, 22 Sep 2014 00:24:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=from:to:cc:subject:date:message-id; bh=DRvqsfc/Lu887ZWgIrPi114zugJLThFbdgStrK9yKKU=; b=ZIxWIunCYpTNje3enNQ30ghCqdbrk1bCaxYBXVaXtDz1Pd5jqYqFVokmsWJLTfjOot TocJN7DNmL5UWVWfGyUmPYLygigUFb3wrTHjBuqKZIwhD+INw8983aQMJu4QDaJuVaWI Bw6xPiWbazpHKRZl9G8AAOxduDNOvXI9WUokeiyMys2/vZgMk6Iy2RJgQAXWoz6JzL1z 4BUUkPYxByY42FiIh2i5SwC/H0EQ3Jbj+zXLTSl6yLHnC25wpAdSsIga4/BpHfeP1xdc aDx6MjbUjbqCHzTOd2RMyd9tLk/Ldx7BmCc2/btpO1/5Xu84LWE+2SZyDTu4y0KOgslN PVog== X-Received: by 10.68.247.137 with SMTP id ye9mr22124766pbc.69.1411370687295; Mon, 22 Sep 2014 00:24:47 -0700 (PDT) Received: from localhost.localdomain ([69.176.84.147]) by mx.google.com with ESMTPSA id dw2sm8518427pab.8.2014.09.22.00.24.41 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 22 Sep 2014 00:24:46 -0700 (PDT) From: Chris Zhong To: dianders@chromium.org, max.schwarz@online.de Subject: [PATCH] i2c-rk3x: move setup to the earlier subsys initcall Date: Mon, 22 Sep 2014 15:24:35 +0800 Message-Id: <1411370675-27866-1-git-send-email-zyw@rock-chips.com> 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-20140922_002508_275401_2C50D316 X-CRM114-Status: UNSURE ( 9.21 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 1.0 (+) Cc: Heiko Stuebner , Wolfram Sang , linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-i2c@vger.kernel.org, Chris Zhong , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 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=-1.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD, UNPARSEABLE_RELAY, URIBL_BLACK autolearn=no 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 Some device using this bus, such as regulators, they should register as early as possible, so the I2C bus master needs to be loaded early. Therefore initialize via subsys_initcall() is better. Signed-off-by: Chris Zhong Acked-By: Max Schwarz Reviewed-by: Doug Anderson Tested-by: Doug Anderson --- drivers/i2c/busses/i2c-rk3x.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-rk3x.c b/drivers/i2c/busses/i2c-rk3x.c index e637c32..5b91901 100644 --- a/drivers/i2c/busses/i2c-rk3x.c +++ b/drivers/i2c/busses/i2c-rk3x.c @@ -760,7 +760,18 @@ static struct platform_driver rk3x_i2c_driver = { }, }; -module_platform_driver(rk3x_i2c_driver); +static int __init rk3x_i2c_init_driver(void) +{ + return platform_driver_register(&rk3x_i2c_driver); +} + +static void __exit rk3x_i2c_exit_driver(void) +{ + platform_driver_unregister(&rk3x_i2c_driver); +} + +subsys_initcall(rk3x_i2c_init_driver); +module_exit(rk3x_i2c_exit_driver); MODULE_DESCRIPTION("Rockchip RK3xxx I2C Bus driver"); MODULE_AUTHOR("Max Schwarz ");