Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp425333pxf; Thu, 8 Apr 2021 06:06:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzC96Yvx94b0x7OfCwlzr3nOzSXzy8r9ExWAqyeOi4BFchiNoXqMuKC9KxPbVRxWRgT3o/9 X-Received: by 2002:a19:3850:: with SMTP id d16mr6354036lfj.473.1617887218520; Thu, 08 Apr 2021 06:06:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617887218; cv=none; d=google.com; s=arc-20160816; b=NGowUFW08x7z08DKWWu7PvY15MKKU7Z7gcRGbl3RZizksLOQtRooyYLtV96PsFnq/j AXinHoCgW3ZrKRy/KwzFgBGglVwMTNnrblf3hKAGKcn7+IsySwQbndjJh0KDNbosYwPJ 0q+TTqH2y+p6yrsdRyAiztpaK7OnNDrXPDaMYeVyKDjwYZeOHo/JG24Wgq5fSvYPrckI vY5IkgXsgHQStV0nu5Rrm4wHZMalHPSGGEfDkk8JL6lFG6fsQZJefj9gG7rgEOc5xIh9 YyWWEpLCN53bnesZeQEOiG5wxZFrswl4EDx8Q/gDOCv+rlxa0i3an7Gp+3kJn2Dtyuas NCIg== 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=h/OaERaqG/OeT0vkR9rvY66d5B1O0+nNoZdLJZd+dHI=; b=DuQbrotXX5qpyUHTTQ30zaSoMeCa713KFPAI9f6njvrQR3PmXdz8shD94nOFHRxQ5y 83zHAg4GyER4j54HkqVFpPX4HKHjsoYzJbhcStMAPhdrdCMZqZLVTihS0sodKpIceGxp 6kisi7uMkNSPWuDZyV0ZsYLdvP0St2QgdG36bL0rgAjHXbMaaBmBU3Wj0WO6mFT0MR7A le9RpxDvawfGe6ZrV35owZ1C1NVLvHmZAGBJ4r6eypdUMDeWs3tV7s11rByyKlyeIVjS MqNjRSQifhADGPyB+mHn/i09xBAQHLTBxGhQ4YA+nQzbkETAeNON9lm9DVZhn2MMAI2U qZWw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id mj22si16876163ejb.425.2021.04.08.06.06.25; Thu, 08 Apr 2021 06:06:58 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231566AbhDHNDU (ORCPT + 99 others); Thu, 8 Apr 2021 09:03:20 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:16410 "EHLO szxga06-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229751AbhDHNDR (ORCPT ); Thu, 8 Apr 2021 09:03:17 -0400 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4FGLx90tJWzkjgD; Thu, 8 Apr 2021 21:01:17 +0800 (CST) Received: from localhost.localdomain (10.175.112.125) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.498.0; Thu, 8 Apr 2021 21:02:54 +0800 From: Chen Huang To: Evgeniy Polyakov , Rikard Falkeborn , Greg Kroah-Hartman CC: , , "Chen Huang" Subject: [PATCH -next 1/2] w1: ds2805: Use module_w1_family to simplify the code Date: Thu, 8 Apr 2021 13:09:53 +0000 Message-ID: <20210408130954.1158963-1-chenhuang5@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.112.125] 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: Chen Huang --- drivers/w1/slaves/w1_ds2805.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/drivers/w1/slaves/w1_ds2805.c b/drivers/w1/slaves/w1_ds2805.c index 206186db727d..6b5d12ba1b65 100644 --- a/drivers/w1/slaves/w1_ds2805.c +++ b/drivers/w1/slaves/w1_ds2805.c @@ -291,20 +291,7 @@ static struct w1_family w1_family_0d = { .fops = &w1_f0d_fops, }; -static int __init w1_f0d_init(void) -{ - pr_info("%s()\n", __func__); - return w1_register_family(&w1_family_0d); -} - -static void __exit w1_f0d_fini(void) -{ - pr_info("%s()\n", __func__); - w1_unregister_family(&w1_family_0d); -} - -module_init(w1_f0d_init); -module_exit(w1_f0d_fini); +module_w1_family(w1_family_0d); MODULE_LICENSE("GPL"); MODULE_AUTHOR("Andrew Worsley amworsley@gmail.com"); -- 2.17.1