From patchwork Wed Mar 15 10:00:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miquel Raynal X-Patchwork-Id: 70106 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp2249858wrd; Wed, 15 Mar 2023 03:37:18 -0700 (PDT) X-Google-Smtp-Source: AK7set8gOYCBG3wHYgNFxnZ2uwBwtAWclCpx/pKJiliXQrG+74rxQnS3WiSwVmLjUBYmLhScB10V X-Received: by 2002:a17:90a:cf0e:b0:23d:1a5c:ff3d with SMTP id h14-20020a17090acf0e00b0023d1a5cff3dmr8364225pju.37.1678876638234; Wed, 15 Mar 2023 03:37:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1678876638; cv=none; d=google.com; s=arc-20160816; b=GGLwbvMwOHwOsV98Xw7vj8u+Bb4Pfjqb+dBAYmlrLqvts7AXP4oLNoGG5va3jtKOY7 l/bz5nQCMWiG0pc1FEyhc36bubmQBTddWnqW30GW0kfzG6e4/fPlc2GjWZZz1EY59MJF z2YmYwEiBGlkBs96uwaJbIakS0/F+inzARcDsivpJSWNElxvxK6PNDwaphVJYvuuaCqC ZqtHruFZdCL2+2wuOWG9GCHrlrxN1lFsVgYAZ5eFChdV/xkFgrf6JUjYM/V6TXz9W1kZ W7hqnjllprwmh2jm2EVP6wLdW6+5q6mjmcYFdr5AhthUoxBPXwlfYqkSaaFRov2UiM7y 79tw== 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=X8q+3qBKuCZzlT3vjk4NJTDyLJ76Yq7oZLAj93l08Y4=; b=jsadgXfbY9eDITyWP1vxzgJrQR2wb0RcgPnANY+P2LvBqnL4AFRCYBmUidECYN9ttD XWO3KEwQ44PR88CFTIdwhwg6yXIjYguF01WhLtN504VwDx66bJkTLrd2NKgDxrWMLhGH 7OJqD6H9oPGaImcOi0pDmcscp0LP7iX/Zv6t3F0jKhwOLcE12DNLGua138o5JfFfsWZr DuJYDrNhmKj5v0ZlwbJDTs7Gs5H2sXIAjtS2QJhdlniTKsoR/nrSn13sHrZariQTs1ks rX6fZhk8lf4lDaamcBvht3zATWbnr5Y24gdrkOb5TsEw8IdU9yStVA+TN1iSugDJ3RWC MeXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=Z+305vMG; 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 gq12-20020a17090b104c00b002340e488cc5si1337015pjb.96.2023.03.15.03.37.05; Wed, 15 Mar 2023 03:37:18 -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=Z+305vMG; 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 S231566AbjCOKDT (ORCPT + 99 others); Wed, 15 Mar 2023 06:03:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231386AbjCOKDB (ORCPT ); Wed, 15 Mar 2023 06:03:01 -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 139A584801 for ; Wed, 15 Mar 2023 03:01:36 -0700 (PDT) Received: (Authenticated sender: miquel.raynal@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 8301F24001B; Wed, 15 Mar 2023 10:01:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1678874493; 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=X8q+3qBKuCZzlT3vjk4NJTDyLJ76Yq7oZLAj93l08Y4=; b=Z+305vMGrWBxbMUW8+OThfe7GJmTmEI0My/WKUGwr7y1ww1G3VVois/r4DR/846kmo//Zs YT91l6mcwXegVNcuGrD/qIGnOz/UAfj8pVsEHBp2bLpu/pbHML7X7VZvo5WexBIc1p/51D B4e+1P5xHJLQQlRI1UML4R/uhOObAM33AleP1sXWrBxA9auWrKjpkC9atFCRblghqA9fSD gFsZO37+2H5P9+l6ALiPoa2HZvqdaSyiYXEQmZai084bqfABGnqaAjgqkxCFUjbxekPnaa xxjFNL4NTuE9dq/fHr/hGHRvefFJ6UtJruxrhMUFVWGSG3rWvhBB9bvoJ8w/Sg== 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 1/4] nvmem: Add macro to register nvmem layout drivers Date: Wed, 15 Mar 2023 11:00:15 +0100 Message-Id: <20230315100018.1660071-2-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?1760429750275621534?= X-GMAIL-MSGID: =?utf-8?q?1760429750275621534?= Provide a module_nvmem_layout_driver() macro at the end of the nvmem-provider.h header to reduce the boilerplate when registering nvmem layout drivers. Suggested-by: Srinivas Kandagatla Signed-off-by: Miquel Raynal --- include/linux/nvmem-provider.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/linux/nvmem-provider.h b/include/linux/nvmem-provider.h index 0cf9f9490514..a1c668018894 100644 --- a/include/linux/nvmem-provider.h +++ b/include/linux/nvmem-provider.h @@ -240,4 +240,9 @@ nvmem_layout_get_match_data(struct nvmem_device *nvmem, } #endif /* CONFIG_NVMEM */ + +#define module_nvmem_layout_driver(__layout_driver) \ + module_driver(__layout_driver, nvmem_layout_register, \ + nvmem_layout_unregister) + #endif /* ifndef _LINUX_NVMEM_PROVIDER_H */ From patchwork Wed Mar 15 10:00:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miquel Raynal X-Patchwork-Id: 70107 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp2251132wrd; Wed, 15 Mar 2023 03:40:59 -0700 (PDT) X-Google-Smtp-Source: AK7set8vwO1ZScIkHAzxfaQN6hxq3Mta1X1PbwEz0acAZLcvFUynVsv3ElDYq1qmfnH0GkfYG0p4 X-Received: by 2002:a05:6a20:3c92:b0:d4:30d2:e8ba with SMTP id b18-20020a056a203c9200b000d430d2e8bamr10429776pzj.12.1678876858883; Wed, 15 Mar 2023 03:40:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1678876858; cv=none; d=google.com; s=arc-20160816; b=u8fKS63O0ZqUlTKi/AE5FQb6Z/r9QmJIN4f9GG5tfwJzv7I8reYB8RexE62Gm51v2H pBYIl2UHkqGMV8ZuvAHSlom9eXL6Eg6+87kniHRaID9ThlSYFJ54aVaJm8xq82ofSrFJ tqPUqxMyQxnG7U27Di0QwmLus8e0XZYnwwBy9GH2ruedU/PeyLGkHYl0AM0zDueUQ+CW GU4Gj70r2Lp/U7TvNqxDnG6TMksIqwuS+8WPbHSWQAyl5AQWXhDtVJ+z9rOUMARzGHwy f0IH03tyX6TkuGQ4mWcPBKdg+RLqqAKb26B5GHXxOydp8MGO85GDuh3e0HpCrAHiI5si oNow== 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=Jt9qgapM8J5DKazv/oWWgNBLPyduMWHrHscsdhszKMY=; b=l3GdVLzVn3d8eoI/1wyQAGEsjauCMSd4OyEO7B6OEXzO59Db4saCzuOtM8Bw49Lwxs YtLdYwRDlzUm5WO1ah3UgqoNFTrBEBUwtekBwCGFWzTlfBbOx+mtnj7NUWh/jeoAR8NK +SAYJtEVTXskLQO1xU7R2YmvA3yP7a/sONq8PBfTDPs2DTFosmzEJiHGyM3AE306npfM ylFKzdwYDXCq7BdOnuGPEqZq6JnFpcNqrxvKje68buqcXp3J5cwS0QCOqkhUcTiU443P wT0fadn27sLDYe7aUYScmVu6UyU355pBypnwDj/hWW5RtRAXvJ9pH0ldlnj85kNH81tn CyAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=QEJSqsno; 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 g124-20020a636b82000000b00502eff43824si4693200pgc.601.2023.03.15.03.40.43; Wed, 15 Mar 2023 03:40: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=QEJSqsno; 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 S231636AbjCOKDX (ORCPT + 99 others); Wed, 15 Mar 2023 06:03:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232016AbjCOKDD (ORCPT ); Wed, 15 Mar 2023 06:03:03 -0400 Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::221]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA13FB744 for ; Wed, 15 Mar 2023 03:01:43 -0700 (PDT) Received: (Authenticated sender: miquel.raynal@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id E73A9240011; Wed, 15 Mar 2023 10:01:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1678874501; 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=Jt9qgapM8J5DKazv/oWWgNBLPyduMWHrHscsdhszKMY=; b=QEJSqsnoSJ+269GXUhQjsEnllspJdika/YcF8pLZT6HGJNwtoOQW2P56DGh8xsH2bZ/9s/ FxQOG/nuvRO8c4CDCeRtWVmHjGk2hcqtGkuw79SFFcZRmb6y0f69hsk+iS8igKN/rYy1sq EXDqLo2gTjBg/T1AZXqLmwmLc4rXorhcv4SpUYTSbib2WTCdNFBRSL3myVjraMX1zCPfVZ kv8bE/I6mpsYEZuxy4JzQCcWsUMLFZWCGaAupqM9yFSX+qdnvtdKYBcE/prkaEhbWuOpt3 /52djAPVy/Os+78FLGVI7f0rKanznUI/P3HGZsm+9Bp2hueT0dZB/oKr+JJ50Q== 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 2/4] nvmem: layouts: sl28vpd: Use module_nvmem_layout_driver() Date: Wed, 15 Mar 2023 11:00:16 +0100 Message-Id: <20230315100018.1660071-3-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,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?1760429981058113515?= X-GMAIL-MSGID: =?utf-8?q?1760429981058113515?= Stop open-coding the module init/exit functions. Use the module_nvmem_layout_driver() instead. Signed-off-by: Miquel Raynal --- drivers/nvmem/layouts/sl28vpd.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/drivers/nvmem/layouts/sl28vpd.c b/drivers/nvmem/layouts/sl28vpd.c index 9370e41bad73..9cc1715c2fd5 100644 --- a/drivers/nvmem/layouts/sl28vpd.c +++ b/drivers/nvmem/layouts/sl28vpd.c @@ -146,19 +146,7 @@ struct nvmem_layout sl28vpd_layout = { .of_match_table = sl28vpd_of_match_table, .add_cells = sl28vpd_add_cells, }; - -static int __init sl28vpd_init(void) -{ - return nvmem_layout_register(&sl28vpd_layout); -} - -static void __exit sl28vpd_exit(void) -{ - nvmem_layout_unregister(&sl28vpd_layout); -} - -module_init(sl28vpd_init); -module_exit(sl28vpd_exit); +module_nvmem_layout_driver(sl28vpd_layout); MODULE_LICENSE("GPL"); MODULE_AUTHOR("Michael Walle "); 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 "); From patchwork Wed Mar 15 10:00:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miquel Raynal X-Patchwork-Id: 70102 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp2246764wrd; Wed, 15 Mar 2023 03:29:27 -0700 (PDT) X-Google-Smtp-Source: AK7set8XQDtsZYI4bz9zR+Rc3EqNUPkrRasc5NsqGwhSSD/1QzcmuccdJ0uZCLUIf07/Mv6hxY3G X-Received: by 2002:a05:6a20:b2a6:b0:d5:b3d1:bff9 with SMTP id ei38-20020a056a20b2a600b000d5b3d1bff9mr4016063pzb.52.1678876167292; Wed, 15 Mar 2023 03:29:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1678876167; cv=none; d=google.com; s=arc-20160816; b=xgZFHKXPrgY6QmelIQdqFmX+IkoouDyCXmD424O8dG6iBlvksZ86b188QQiRIte1fV aNkzyQRzl5yeb0vfhRpa3oas+7fvRJD8yrQur8lbNu2iuZgqoKzKJ0B+jvMiiGv7z6wu mgvpIH6RJD9kpTx9ZcEmPObflYxqVXJxXj6VDK0Rv8jHRLTVYepz1KLuR0NzZcjgv1ym bzLRRG7wfCgzjTQYAOCzLD9sJiUq4UaavLk66NszfmSlZNrW1Yv+9rz78l0K0Pp/aEPh I45v5hHe2TLZDTp71hPjZ9rybumVLMa63g9pfKoAWtmFKgs89LsH3dUlZ2yuGMBX1iZi WkQw== 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=Puld4+WhROgZ/4Yw9OR4slf5b+hhfbuzWKmJzO6kHVg=; b=Babt7Fe3J3yjP/oCml3KIVxRYHdreX6SXZeHquYVcW8Bilg0XwHVZRpeGEAtU1mX2J 6ZfCniqTY0e8NZc30BkGMG9Y0kaeRn5fR2O7F5EQoppyrEk6zV7IrhThNaAyr5m7u/tq On2bRTYUgbAAiMMYZZsc+slLK48WyKhbPjIA2qkRePrB5My7y4bRYHWKEm9vESkBx7yy vztBp7dWzA7Vf8bDBoevO++K+jpkqCmpnZhysFnI+8CFPOHw2tIPcKXJlAatj3lvnAGM 1Vwp61ZHdUk6gHspW2ETpBQ3GUqCcEKd8j9cOsNxRcR1xRmDTovvARKjds5mzRH1gq+S TYLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b="k2nFxy/3"; 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 b28-20020aa7951c000000b006254213ed4csi4688744pfp.91.2023.03.15.03.29.14; Wed, 15 Mar 2023 03:29:27 -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="k2nFxy/3"; 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 S230491AbjCOKDj (ORCPT + 99 others); Wed, 15 Mar 2023 06:03:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230009AbjCOKDP (ORCPT ); Wed, 15 Mar 2023 06:03:15 -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 7F34886DDC for ; Wed, 15 Mar 2023 03:01:55 -0700 (PDT) Received: (Authenticated sender: miquel.raynal@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id CE2C524000E; Wed, 15 Mar 2023 10:01:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1678874513; 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=Puld4+WhROgZ/4Yw9OR4slf5b+hhfbuzWKmJzO6kHVg=; b=k2nFxy/36jtqWQ+3m7ylzj6fd5YIRkWAWXeuMD+pDVwGuD6D6TenmFq8G9QeDVavB4NBDB PMwsMOWlkErAbDGw1TOCVDs99gsxXEaY2ceDoXGzmUoD5EViaBh1nFat1p/YFkyuyXlNbT GPsYpcX5/Dw+ChLImwIj0SR0zHs94xFXNIOC709TN+HoWHCK3wF3C7X5xqT5JmAyR/nfKg FRTLLttyjE4sHjpvqrUwSvc6JU0ZgAczUGm8YKoboypWEGx52NQ7ZjQILBnEoTsfsB4lPj LvWxLQPfpJbEvfJLae1bYggLv3rQ9vMn1GMDpGyuShgES35cHd9m6onNSe+mnA== 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 4/4] nvmem: layouts: onie-tlv: Drop wrong module alias Date: Wed, 15 Mar 2023 11:00:18 +0100 Message-Id: <20230315100018.1660071-5-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?1760429256142636443?= X-GMAIL-MSGID: =?utf-8?q?1760429256142636443?= The MODULE_ALIAS macro is misused here as it carries the description. There is currently no relevant alias to provide so let's just drop it. Signed-off-by: Miquel Raynal --- drivers/nvmem/layouts/onie-tlv.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/nvmem/layouts/onie-tlv.c b/drivers/nvmem/layouts/onie-tlv.c index 661093de33b4..59fc87ccfcff 100644 --- a/drivers/nvmem/layouts/onie-tlv.c +++ b/drivers/nvmem/layouts/onie-tlv.c @@ -242,4 +242,3 @@ module_nvmem_layout_driver(onie_tlv_layout); MODULE_LICENSE("GPL"); MODULE_AUTHOR("Miquel Raynal "); MODULE_DESCRIPTION("NVMEM layout driver for Onie TLV table parsing"); -MODULE_ALIAS("NVMEM layout driver for Onie TLV table parsing");