Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp422526pxf; Thu, 8 Apr 2021 06:04:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwbCUlILF/sSGToQuyayJifmMes704W7zCoLoUpaxyADoiBtIYLF+4gUYAYllqAgAGiUtMA X-Received: by 2002:ac2:5dcf:: with SMTP id x15mr5979750lfq.176.1617887072983; Thu, 08 Apr 2021 06:04:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617887072; cv=none; d=google.com; s=arc-20160816; b=Kl5w/gmilon5/gNkuXQT78hLEhIaLEI57qck+FwSiDiiJa3IfTaNivCSaquae5ZhUS +z2KXfRC4ShmBOXI+yQprCan0GWwVnAsK2yYrkUEIKd/SqRO0+PT14fGabjOX7teQAFm AnBHgVy3K9YKeuoilA56aNNtI2Q/YoHa662Bp+0AYm/KIxn3iFRgT90/m7y1a+Chu3PP bYZddavu3RJ9dIy8XhcCR2FALASQOVIPFCSoggg7QaxDw5oBK924Ntm45Fny247kr7Hq fW0cf54wKOwprIOanDSzcENZlZ4D8+t7ILGhIcV+vlKCigmshjE+XuBBlwSYO/4HUskM W2kw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=01V9yMIWtlVkoaV95GF4xbVfZcSpqdv6CKUZhBSkk6E=; b=nNR0wHEwKuhrny4rvU2OtQTQI/IAH9Ajvi1L6GuTbLy/I1sZ9FN7TW70tX6LHWdsNY JF5jtH7Cnqp/BT71Z1Iy4NCSsnFDYW/wxcKUG5ATnTkrc1WX3/73fZx5zr4dvQ8t9+O8 JKZT5hPGNC1vDZ1vj5IUDT/5rA+UoB7tFgzqRT4wk79OfPEghla9lzQ2JCfuzh1qtt8i J3n3rX/pIZKUzPmyaMHlb5DhZnY8f/pAUPBxCaY3IuCf9RN3OokjacH/99mIu1Mjew1Z Fs2L1UcNboiwannSenj2joAxUsRPxw9QukMyXMezRfjqNVxnNCXVglb8kMVaDv9C18YF iQ9A== 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 q1si21712775ejy.298.2021.04.08.06.04.06; Thu, 08 Apr 2021 06:04:32 -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 S231526AbhDHNDS (ORCPT + 99 others); Thu, 8 Apr 2021 09:03:18 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:16411 "EHLO szxga06-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230467AbhDHNDR (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 4FGLx90fmpzkjg5; 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:55 +0800 From: Chen Huang To: Evgeniy Polyakov , Rikard Falkeborn , Greg Kroah-Hartman CC: , , "Chen Huang" Subject: [PATCH -next 2/2] w1: ds28e17: Use module_w1_family to simplify the code Date: Thu, 8 Apr 2021 13:09:54 +0000 Message-ID: <20210408130954.1158963-2-chenhuang5@huawei.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210408130954.1158963-1-chenhuang5@huawei.com> References: <20210408130954.1158963-1-chenhuang5@huawei.com> 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_ds28e17.c | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/drivers/w1/slaves/w1_ds28e17.c b/drivers/w1/slaves/w1_ds28e17.c index 6b00db7169ab..aed10b72fc99 100644 --- a/drivers/w1/slaves/w1_ds28e17.c +++ b/drivers/w1/slaves/w1_ds28e17.c @@ -752,18 +752,4 @@ static struct w1_family w1_family_19 = { .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.17.1