Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp871280pxk; Thu, 17 Sep 2020 19:51:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzKHNTXJZuiCAubnTxGFz3JH+5LRBkM16kUMu3EqyscFCQUBgxR4/Vj1T8RsbBWcL70Hzua X-Received: by 2002:aa7:c7c1:: with SMTP id o1mr37565618eds.368.1600397475894; Thu, 17 Sep 2020 19:51:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600397475; cv=none; d=google.com; s=arc-20160816; b=0LrE/5OxjWO8kWsqilWQbPFbghpAalmZQdgKqY09+s5XNQgDyPr7GHVyK21oCNGg7Z oBzXrHK3F1dFc/f44nVA6h7JO6Qnw8cyxDHg4dG3HIpc+hKJQBK2bld/9+3Qim0UDxPX fmSxi7+iOQE1K1PCPR4Pggk9RKADTTRqaYeaUGZeq+0OWVeHK8nexvH43vHDOjM3xooR su85O56n/FvBEHnZorb2BTIw67Mq8MGZCYEzUwwIsVF6NV1Sj5qw6Ihoa/51/TyBbbns xy9gKxycGoouv+EbTtPmEHXEt04aPjmpkj6/TL1sEu86Xeni73QJulMjB0bqDiPHMLd9 5PcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=QJASdQ2AvdWArAgdyRSpD8K53QA9xw7Mro8zkK93mXg=; b=Y4pJ6yXsXdvKzSjK0EkoWr/dZ6akvV14m5Ag+9tje2NWeSVnAb8AB38xb/hX13Usiz UvMq0b1dex4l5LjRmMykioQVl9lxVv99/dwJMuZ+tL0uEvu+g/ECzmODPBrI58spb+zj vCdFVMcM4gIOA3RcehCx3fwf7kCvJylwwCR6DnY6EY6sfW+PrRtJptrTqDW66uX2LWXG Y5/NZ7KZLhcENxeO30qYG9y7Kxdhy3HNBWIAgImznJJqMgqBGwuUiJmNxqKlHdMKWz9a m90GFk9ePSeplW9gH/rwVkSDrEVpmyNjjJwTpjOS5lvBQbvqY/nLepjZBzqfRLKZFlnO 0MWg== 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 u10si1251551ejy.154.2020.09.17.19.50.53; Thu, 17 Sep 2020 19:51:15 -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 S1727807AbgIRCtC (ORCPT + 99 others); Thu, 17 Sep 2020 22:49:02 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:13250 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730306AbgIRCsw (ORCPT ); Thu, 17 Sep 2020 22:48:52 -0400 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id B67D5D27B7108AEF2E08; Fri, 18 Sep 2020 10:48:50 +0800 (CST) Received: from huawei.com (10.175.113.32) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.487.0; Fri, 18 Sep 2020 10:48:43 +0800 From: Liu Shixin To: Evgeniy Polyakov CC: , Liu Shixin Subject: [PATCH -next] w1: ds28e17: use module_w1_family to simplify the code Date: Fri, 18 Sep 2020 11:11:15 +0800 Message-ID: <20200918031115.3982776-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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org module_w1_family() makes the code simpler by eliminating boilerplate code. Signed-off-by: Liu Shixin --- drivers/w1/slaves/w1_ds28e17.c | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/drivers/w1/slaves/w1_ds28e17.c b/drivers/w1/slaves/w1_ds28e17.c index 046ddda83df9..d165aa9d803f 100644 --- a/drivers/w1/slaves/w1_ds28e17.c +++ b/drivers/w1/slaves/w1_ds28e17.c @@ -751,19 +751,4 @@ static struct w1_family w1_family_19 = { .fid = W1_FAMILY_DS28E17, .fops = &w1_f19_fops, }; - - -/* Module init and remove functions. */ -static int __init w1_f19_init(void) -{ - return w1_register_family(&w1_family_19); -} - -static void __exit w1_f19_fini(void) -{ - w1_unregister_family(&w1_family_19); -} - -module_init(w1_f19_init); -module_exit(w1_f19_fini); - +module_w1_family(w1_family_19); -- 2.25.1