From patchwork Mon Oct 8 12:39:52 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 190010 X-Patchwork-Delegate: scottwood@freescale.com Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [IPv6:::1]) by ozlabs.org (Postfix) with ESMTP id 841492C0324 for ; Mon, 8 Oct 2012 23:40:24 +1100 (EST) Received: from mail-qa0-f44.google.com (mail-qa0-f44.google.com [209.85.216.44]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 78CF32C0314; Mon, 8 Oct 2012 23:39:55 +1100 (EST) Received: by mail-qa0-f44.google.com with SMTP id 25so2243281qao.17 for ; Mon, 08 Oct 2012 05:39:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:cc:content-type; bh=xGRdieP6mSzsTZwwUq6WRkdzBV5Qs1QIqaBamAgCgPU=; b=cYx2jn8d+4YqWc+ngHppEAUdQWhIJzVsWYjPYgi5zsnrI7BjJ5mrsZwAsfsFLCz3jV +iiqXS6KOJS033kuK8l0dyXTnDFBFd6hc5r/1BN5V96rPGiiISYbbHz6Pgc3kjz8KA+/ crpAU2m8s/cz7nSOzSPqxpTZKqLaJfM6N0YYzk80EEKNqx29DpT1Z6aKJd9nouL9f5iV r53UNCoVXR6fvkUhkD4s3dK9aUEafo0KW6f8X5m5Dw/J/xisQirKMnlC0M32fMnmIaUu PtdovjqsATFRKrKZLZd9PoHDIeIkCIf9Hh1UNURFM1FpczzNGt72uT6f8pQSVKdmCl6D ab8A== MIME-Version: 1.0 Received: by 10.224.178.4 with SMTP id bk4mr11674057qab.38.1349699993019; Mon, 08 Oct 2012 05:39:53 -0700 (PDT) Received: by 10.229.146.194 with HTTP; Mon, 8 Oct 2012 05:39:52 -0700 (PDT) Date: Mon, 8 Oct 2012 20:39:52 +0800 Message-ID: Subject: [PATCH] powerpc/83xx: use module_i2c_driver to simplify the code From: Wei Yongjun To: galak@kernel.crashing.org, benh@kernel.crashing.org, paulus@samba.org, grant.likely@secretlab.ca, rob.herring@calxeda.com Cc: yongjun_wei@trendmicro.com.cn, linuxppc-dev@lists.ozlabs.org, devicetree-discuss@lists.ozlabs.org, linux-kernel@vger.kernel.org X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" From: Wei Yongjun Use the module_i2c_driver() macro to make the code smaller and a bit simpler. dpatch engine is used to auto generate this patch. (https://github.com/weiyj/dpatch) Signed-off-by: Wei Yongjun --- arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c b/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c index ef6537b..d91799e 100644 --- a/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c +++ b/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c @@ -232,17 +232,7 @@ static struct i2c_driver mcu_driver = { .id_table = mcu_ids, }; -static int __init mcu_init(void) -{ - return i2c_add_driver(&mcu_driver); -} -module_init(mcu_init); - -static void __exit mcu_exit(void) -{ - i2c_del_driver(&mcu_driver); -} -module_exit(mcu_exit); +module_i2c_driver(mcu_driver); MODULE_DESCRIPTION("Power Management and GPIO expander driver for " "MPC8349E-mITX-compatible MCU");