From patchwork Thu May 29 11:43:22 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 31119 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f199.google.com (mail-vc0-f199.google.com [209.85.220.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6257B203E6 for ; Thu, 29 May 2014 11:45:56 +0000 (UTC) Received: by mail-vc0-f199.google.com with SMTP id id10sf20938vcb.2 for ; Thu, 29 May 2014 04:45:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=UB5S6OWNNzWvmQmHseLsvexRKCqogoumoHx4SeUsOrQ=; b=iXbj3BEckRRcZ7A7kU803TsP3nVGVUTAfuI5FVYG9TWsemZAisaSp14vjt2BgwdJzi RzKqYGGq78ZgSDJff/S6vXW2sJaqRFBMVennVyQJBF9eMaptFwP/5PBaUkkOOtAV7z75 izYRQj71uTRSzkRVpuZxrDZp4O0jhFiOMQtUy2blduKRz7tC0gBZHFmxY5xg6AqvhPkq N72nlQrZsHIMlIdiTC5y5+D3/h9PVk8WLp3/mFIln9nrOlrz/EYWeRUtiz5HEAQaV6mY 9QFH0a7TrpoD+e07CmfyYUJIahW4v7fYbvH+ikhuvBn2yjQTqLt1MG9hFSOfQRGZJSsm a32g== X-Gm-Message-State: ALoCoQkdgKZFLl05Yk4Qc6fJcJzYRF24X4/5QjgLeZStuSz0otW8Eft3co1jqxFV/0gQVypKBicL X-Received: by 10.58.195.202 with SMTP id ig10mr2804655vec.38.1401363956141; Thu, 29 May 2014 04:45:56 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.83.50 with SMTP id i47ls514991qgd.38.gmail; Thu, 29 May 2014 04:45:56 -0700 (PDT) X-Received: by 10.52.235.97 with SMTP id ul1mr144445vdc.87.1401363956060; Thu, 29 May 2014 04:45:56 -0700 (PDT) Received: from mail-ve0-f179.google.com (mail-ve0-f179.google.com [209.85.128.179]) by mx.google.com with ESMTPS id fe3si255151vec.43.2014.05.29.04.45.56 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 29 May 2014 04:45:56 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.179 as permitted sender) client-ip=209.85.128.179; Received: by mail-ve0-f179.google.com with SMTP id oy12so212822veb.38 for ; Thu, 29 May 2014 04:45:56 -0700 (PDT) X-Received: by 10.52.236.163 with SMTP id uv3mr145908vdc.85.1401363955985; Thu, 29 May 2014 04:45:55 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp21713vcb; Thu, 29 May 2014 04:45:55 -0700 (PDT) X-Received: by 10.66.177.102 with SMTP id cp6mr7796800pac.57.1401363955309; Thu, 29 May 2014 04:45:55 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ew3si559348pac.229.2014.05.29.04.45.54; Thu, 29 May 2014 04:45:54 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757070AbaE2Lpr (ORCPT + 27 others); Thu, 29 May 2014 07:45:47 -0400 Received: from mail-pb0-f47.google.com ([209.85.160.47]:33930 "EHLO mail-pb0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751902AbaE2Lpp (ORCPT ); Thu, 29 May 2014 07:45:45 -0400 Received: by mail-pb0-f47.google.com with SMTP id rp16so240881pbb.20 for ; Thu, 29 May 2014 04:45:45 -0700 (PDT) X-Received: by 10.68.163.197 with SMTP id yk5mr7955347pbb.57.1401363945352; Thu, 29 May 2014 04:45:45 -0700 (PDT) Received: from linaro.sisodomain.com ([14.140.216.146]) by mx.google.com with ESMTPSA id ee5sm858857pbc.47.2014.05.29.04.45.42 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 29 May 2014 04:45:44 -0700 (PDT) From: Sachin Kamat To: linux-kernel@vger.kernel.org Cc: lee.jones@linaro.org, sachin.kamat@linaro.org Subject: [PATCH 1/1] mfd: menelaus: Use module_i2c_driver Date: Thu, 29 May 2014 17:13:22 +0530 Message-Id: <1401363802-18961-1-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.9.5 Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: sachin.kamat@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.179 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , module_i2c_driver simplifies the code by eliminating boilerplate code. Signed-off-by: Sachin Kamat --- drivers/mfd/menelaus.c | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/drivers/mfd/menelaus.c b/drivers/mfd/menelaus.c index ad25bfa3fb02..5e2667afe2bc 100644 --- a/drivers/mfd/menelaus.c +++ b/drivers/mfd/menelaus.c @@ -1287,29 +1287,8 @@ static struct i2c_driver menelaus_i2c_driver = { .id_table = menelaus_id, }; -static int __init menelaus_init(void) -{ - int res; - - res = i2c_add_driver(&menelaus_i2c_driver); - if (res < 0) { - pr_err(DRIVER_NAME ": driver registration failed\n"); - return res; - } - - return 0; -} - -static void __exit menelaus_exit(void) -{ - i2c_del_driver(&menelaus_i2c_driver); - - /* FIXME: Shutdown menelaus parts that can be shut down */ -} +module_i2c_driver(menelaus_i2c_driver); MODULE_AUTHOR("Texas Instruments, Inc. (and others)"); MODULE_DESCRIPTION("I2C interface for Menelaus."); MODULE_LICENSE("GPL"); - -module_init(menelaus_init); -module_exit(menelaus_exit);