Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1940827pxk; Sun, 13 Sep 2020 23:32:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwIwBX1z0qih+WKpf8zQ+hYeQdHHFoIF8jpsPudXqsjd+qDhNUjy51DeP9sX3nBNp0+s9hA X-Received: by 2002:a50:ce06:: with SMTP id y6mr15868116edi.273.1600065164563; Sun, 13 Sep 2020 23:32:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600065164; cv=none; d=google.com; s=arc-20160816; b=0fTzbyK81Ch0pZVR0PAhgxMmmBlS+mHO+m7aTBKXJKi3cfTrMk53kGBa9nU7UWb4Si mqbRSDNH0ildxbKSjquNEb6GZVTAZ1HcCorzrM2qYv7IiHTHGKG4AnSUzmsWOAPie279 ekbqTxAwZit4IyU81HbxEH6Jm0kUCRZpiczfDV2dG15zm9qKQ0c9b71Ci+qkGpe2C5Tt zZE1c545w9t3pOOmF4ZXtojRFHAv6/1jO/R0cvFHDyLUR2UV9FRw3+mDp4RkDupntfjt mM2wCiJbDXK4iAtkQF2b7UnX7w0/hkVIy0+fp7mFgussZ5hbOXWSfWDI66lOy8AOp09U PgRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=00BJZUv67L7HcFfwAkHljqFtbexuCGMfbMM5yVtd/yk=; b=FdQxBpNAEtTvPzV+XHj8kx/Tr2GX/j+f1w2RgXD0coJ0xY7/BmfjNI8umFTA8lPyTq 1zNl/oKCd8ezNrBwswn4dPd8OP821S7ztyxibygSYjYlEG50nUGQ21J4Y7xLhmf1iSYp PH0zqtsVcQnHmnYACHH3zvRNsdSbq0vP442fN2CRHihgCNNJJN8E7X/dFiA2ZgiQv7mA xPmqFJMwIU9/VQoxdfgA5c1Yzk9rR7Axn2ltgdalyiuSi4OHfcggoYGy/Lvoix3421kp j09+yWac0iA4KS3zzEIsVxcTixA79Eu6iTXTWpARYEiXECljdZaAdbV4Z0cuH3kH5ymi t7HQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n6si6533390edy.596.2020.09.13.23.32.22; Sun, 13 Sep 2020 23:32:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726095AbgINGbd (ORCPT + 99 others); Mon, 14 Sep 2020 02:31:33 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:11828 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726067AbgINGba (ORCPT ); Mon, 14 Sep 2020 02:31:30 -0400 Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id E0B77305C6FCFD67C0F9; Mon, 14 Sep 2020 14:31:27 +0800 (CST) Received: from huawei.com (10.175.113.32) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.487.0; Mon, 14 Sep 2020 14:31:21 +0800 From: Liu Shixin To: Jonathan Cameron , Hartmut Knaack CC: , , Liu Shixin Subject: [PATCH -next] iio: adc: palmas_gpadc: use module_platform_driver to simplify the code Date: Mon, 14 Sep 2020 14:54:01 +0800 Message-ID: <20200914065401.3726354-1-liushixin2@huawei.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.113.32] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org module_platform_driver() makes the code simpler by eliminating boilerplate code. Signed-off-by: Liu Shixin --- drivers/iio/adc/palmas_gpadc.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/drivers/iio/adc/palmas_gpadc.c b/drivers/iio/adc/palmas_gpadc.c index 1ca6570be66a..889b88768b63 100644 --- a/drivers/iio/adc/palmas_gpadc.c +++ b/drivers/iio/adc/palmas_gpadc.c @@ -834,18 +834,7 @@ static struct platform_driver palmas_gpadc_driver = { .of_match_table = of_palmas_gpadc_match_tbl, }, }; - -static int __init palmas_gpadc_init(void) -{ - return platform_driver_register(&palmas_gpadc_driver); -} -module_init(palmas_gpadc_init); - -static void __exit palmas_gpadc_exit(void) -{ - platform_driver_unregister(&palmas_gpadc_driver); -} -module_exit(palmas_gpadc_exit); +module_platform_driver(palmas_gpadc_driver); MODULE_DESCRIPTION("palmas GPADC driver"); MODULE_AUTHOR("Pradeep Goudagunta"); -- 2.25.1