From patchwork Wed Mar 15 10:00:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miquel Raynal X-Patchwork-Id: 70110 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp2253016wrd; Wed, 15 Mar 2023 03:45:58 -0700 (PDT) X-Google-Smtp-Source: AK7set80sgATkmVk/ZPaL66xfvQxj3Y9fvfWRMqVutm7bjmvChZM6aHiOyId7qXt10mgO+jeJpAm X-Received: by 2002:a17:902:ec87:b0:19f:2e2b:3577 with SMTP id x7-20020a170902ec8700b0019f2e2b3577mr2366338plg.41.1678877158291; Wed, 15 Mar 2023 03:45:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1678877158; cv=none; d=google.com; s=arc-20160816; b=XwquzXyUGlRsPnPmz7E6bF1rKZh+yKd8v3rKW/C+PDurGQY16oqXVZ4Wt19pqYLleC 5SLegmz0t2HcLnegFyHThOXxBr4ovtqrpC1x7Bja0I/7ixZqdaOp6fQRkGETMfUAcxwy idFy2DhxjNQt051j1jgGumzFN/os+8eIgD1L+7rHiHewsPuSWXLBS4tWLWbnvD7IAAaG CAXLVCI/s4C74BLt+ZmcR8hzlWgjxGR6IFrPAzoSlN7QNJ0DQb/i4s14YeHRR9tiY+Md +CLIN5F+CulYxuPUbDF+FjWi7fYlK7C5IfxA81Zibib0Nc65DQhRNKk+OPB1fS6TtUQK tihA== 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=NCox8aK4MpPD7CUvLgNfUXBX0fcHNgi5v+ju0KyzN8GVVP3X3A5z0FXJZv9sVtubfh D+CUU3mnQFte6ng4fcuL1PsIR3UyEKLvu3wxOP5AuLaeU7rixBTISrs3Ev4OP5Kh9zhv EIw0z2PQpI5cG5bg2vY/0Q2vHfCtbO3pIGo7l5sBtejZ4F+wb2VeV75zsM0mkrqce5bu XZTirRT3Iod4B6ntEKXDb+dnHmGsKCRVRnQH1cYkZ3QY/cGSmOdBFqmCQjp3cjQ6Kf/8 lWBOlkod2/aGAfhlemeM3Al6tzYcRpyR9x1YcxKWJzsTvTCSqJeinQW18RF1/FlhAEMx we3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=hRZWVl+c; 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 ji11-20020a170903324b00b0019a863d5ab3si5107573plb.106.2023.03.15.03.45.46; Wed, 15 Mar 2023 03:45:58 -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=hRZWVl+c; 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 S231772AbjCOKDg (ORCPT + 99 others); Wed, 15 Mar 2023 06:03:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55400 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231741AbjCOKDM (ORCPT ); Wed, 15 Mar 2023 06:03:12 -0400 Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB1C93C30 for ; Wed, 15 Mar 2023 03:01:48 -0700 (PDT) Received: (Authenticated sender: miquel.raynal@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id C5E94240017; Wed, 15 Mar 2023 10:01:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1678874506; 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=hRZWVl+cemyALVywZ7FAy4etTmVvT+lGYLpREwYln9ATVv6SCGk+Jytfo+oU9MUsGMymwS FQEOIMKtFnTrLJ9VYSErRsur+o6O4CkUUWNo4USf/c4UQsa7uCnC95HpnUB/KydV0roAso Kg+ljwQ88styGW9KfENQcF1nX+/4g8yb1RN0uJyMiaB+FFfi+M/pfpRgTr02HcOkeDzd0k +m1f2RDxlZ+8RHYNhcm4Q2feoATNb661aDNMieI9ngG9roOGReU7t0OfDFOeuCknIwu4EW rFq5836FPQ8xkynNL7bpGS0kkfSQqz67o5RZYKxgpmsjvUH56BAAs29SwKd/Yg== From: Miquel Raynal To: Srinivas Kandagatla , Greg Kroah-Hartman , Cc: Michael Walle , =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= , Robert Marko , Luka Perkov , Thomas Petazzoni , Miquel Raynal Subject: [PATCH 3/4] nvmem: layouts: onie-tlv: Use module_nvmem_layout_driver() Date: Wed, 15 Mar 2023 11:00:17 +0100 Message-Id: <20230315100018.1660071-4-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230315100018.1660071-1-miquel.raynal@bootlin.com> References: <20230315100018.1660071-1-miquel.raynal@bootlin.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham 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?1760430294829087208?= X-GMAIL-MSGID: =?utf-8?q?1760430294829087208?= 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 ");