From patchwork Wed Mar 22 16:58:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miquel Raynal X-Patchwork-Id: 73533 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp2453519wrt; Wed, 22 Mar 2023 10:04:03 -0700 (PDT) X-Google-Smtp-Source: AK7set8NghcC1L099M6ZMWdkBoxRNU6o9p9zbx8ufUccvdJXG7vzTzbHcj3A8o8EbLWCGn5C5Ylp X-Received: by 2002:aa7:da97:0:b0:501:c839:cf91 with SMTP id q23-20020aa7da97000000b00501c839cf91mr7554941eds.6.1679504643332; Wed, 22 Mar 2023 10:04:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679504643; cv=none; d=google.com; s=arc-20160816; b=Ff45IifzOvF72fiPS9qevM20SSpZnyj3aSAk/3qYFjJEfblvICFcXeI259gR8CM81O VCiSyX5dB70dvOnf9cPHFfm7k1CHltu6AgZHxaxKY1Rkg8HF4djvRZbmlh45xmGAq5Z3 wjZMyXSzqfQE3b/p91J8UrsR21rq6UDpi1Ztc3wLPGGzV8vzd3TVXtvFomPdcDsF6LRB 5zj8nj2M3rMorxflk4mOOlxMBfjORKeuHtOtS/tyDQnGx6OEA4BuKz5FvGaEJllIZDHY ehn9114FMUt52UZT+2RJUWYGADAk5tlT5Nal4RSSj/VZefxHUchDb0aNhiu64bmflfDd h6PA== 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 :dkim-signature; bh=NwGFCbZSoqGsZ7G/hAD6P/+MSzXVxeFCZOQ7R1WJyko=; b=qgngSyyyTLR3r66JB68/2HthNMdsdIWlCKeFwaC4LKixB40eo8P/tG5Etl5hpv53h4 N3K8tEMJWhCK/a5Aszw3OpqfUw+DdwXykKyLOrtrLeoqHmBQ8YoJ5nyCtZjKhVkEZNfn VxNX/Wam/dJd0fmbHYyuAO/OqyOh3R0p6nbXRGe3mavH6Iu3g5RPFnywJoOM2nNTCtsd oYZi+M0nvlK37gY7CVW97/KdO0KHHS0vMfmOxjdgxS/BgAivhcyxQv/uhHOgHfP1tNTO VL7PhyC/rKKl4NuwSCiPdn5W9A32N9puGg3ApQaNVAiGTvxXhBcr2ebp3jR5G2Hl9SIc dfGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=RgP3X2dB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 2-20020a170906014200b008ca8e21134esi18061778ejh.281.2023.03.22.10.03.34; Wed, 22 Mar 2023 10:04:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=RgP3X2dB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231211AbjCVQ6S (ORCPT + 99 others); Wed, 22 Mar 2023 12:58:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43184 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230481AbjCVQ6L (ORCPT ); Wed, 22 Mar 2023 12:58:11 -0400 Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E2431716A for ; Wed, 22 Mar 2023 09:58:10 -0700 (PDT) Received: (Authenticated sender: miquel.raynal@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 7938320012; Wed, 22 Mar 2023 16:58:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1679504289; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NwGFCbZSoqGsZ7G/hAD6P/+MSzXVxeFCZOQ7R1WJyko=; b=RgP3X2dB2tYp3ATPhT+w1AzWTbMO7BhURoilAvptfZEfFw019qL/K0r5CcvZXmiOKGEHh1 pqGp7MQnxe+nLuj26Msb6SGhu9HZMe4QXYstpe5QMiIQDPqjLoXVV6HCZb233eJTYVyaIa H3Hx2xTRjl5nYW6il2kz0TXhfK4Zs8Crq6E59s2BLvSijWwLvO39dB26HzuhFCpklucaN3 VIxd8b5lTwPbmZ2xNwj7oZZF9mpTUJJnihI+adOBcikg0TgcyME4xzfYbomO/UeAuzkrHe 1sr3Fej+8mw4yOiYEYF8WW+YdvSQM5UBjnNa6+qaMZJcpP3FFgO0l5cpYp6u2w== From: Miquel Raynal To: Srinivas Kandagatla , Greg Kroah-Hartman , Cc: Robert Marko , Luka Perkov , Thomas Petazzoni , Michael Walle , =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= , Miquel Raynal Subject: [PATCH v2 3/4] nvmem: layouts: onie-tlv: Use module_nvmem_layout_driver() Date: Wed, 22 Mar 2023 17:58:03 +0100 Message-Id: <20230322165804.2240285-4-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230322165804.2240285-1-miquel.raynal@bootlin.com> References: <20230322165804.2240285-1-miquel.raynal@bootlin.com> MIME-Version: 1.0 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761088260998846055?= X-GMAIL-MSGID: =?utf-8?q?1761088260998846055?= Stop open-coding the module init/exit functions. Use the module_nvmem_layout_driver() instead. Signed-off-by: Miquel Raynal --- drivers/nvmem/layouts/onie-tlv.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/drivers/nvmem/layouts/onie-tlv.c b/drivers/nvmem/layouts/onie-tlv.c index d45b7301a69d..661093de33b4 100644 --- a/drivers/nvmem/layouts/onie-tlv.c +++ b/drivers/nvmem/layouts/onie-tlv.c @@ -237,19 +237,7 @@ static struct nvmem_layout onie_tlv_layout = { .of_match_table = onie_tlv_of_match_table, .add_cells = onie_tlv_parse_table, }; - -static int __init onie_tlv_init(void) -{ - return nvmem_layout_register(&onie_tlv_layout); -} - -static void __exit onie_tlv_exit(void) -{ - nvmem_layout_unregister(&onie_tlv_layout); -} - -module_init(onie_tlv_init); -module_exit(onie_tlv_exit); +module_nvmem_layout_driver(onie_tlv_layout); MODULE_LICENSE("GPL"); MODULE_AUTHOR("Miquel Raynal ");