From patchwork Wed Mar 22 16:58:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miquel Raynal X-Patchwork-Id: 73549 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp2460940wrt; Wed, 22 Mar 2023 10:16:39 -0700 (PDT) X-Google-Smtp-Source: AK7set+lpkmtKxalv9gG93t90hIIrzw03HlLC6zZUkzV1WrzUsV0HDXAp/43FayvLZzuf3DP6x9M X-Received: by 2002:a05:6402:205b:b0:501:d43e:d1e6 with SMTP id bc27-20020a056402205b00b00501d43ed1e6mr7748560edb.4.1679505398976; Wed, 22 Mar 2023 10:16:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679505398; cv=none; d=google.com; s=arc-20160816; b=Qe2Ehr+V4gGzsgZjvFvCEOSEvZEponv6YQuf7zOG8axN25AQ72tbuyj/aJ+kp69AOf emKWcqV+FQlKPFTjchwOWo5lcdd/eqP9vYhuUxOFo0wo/mdYQWVaqYagggdrnJEFzfca yH02ttCTlTfjE+TYYdA1W7NZY/m4C2PmTwj+mibePiTUPJ1VxsoCefOxiFAvnbYqwStX gY0A8a+rByqeum17EN+dRcoE7+smZNYY7igIsd0Wyp7xbRpuHN34kkLvFPUkvcIXxAri uRKdy56owiO33xp5b2PzNCY3baBEW/sXkHjR2EbtjFP7g05zntLufPY3V9HMCjOd1oie k83Q== 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=Z0DSwTWAElJZIp9DwGFl/1GywW/Rxfgdyjr2ORr+Pfg=; b=NwBc//WCL02x4rk/6Ts+j9i6nR7hMnJJIlQguByW7KCfuC8y4bO0mvC1ozlaBKfVFS MJHoZeuHKW9gF8yC+iDYJl1dYSB3GmjgQTsVASQDNHz8CHSD68zhXgYCH6tvAEmE0uNi PXRuaDoHUStzBdV2JNfxDnZSF9Knj9UzrvIW/JPloHTFWMv5WL5We6NjVKmlL/ttqZJZ GfYELZI4B+uFTAvyVSF9pBKtCCRpQR1x+ED7Gn5JqjihTPRtDpYsngTCQvwhul22h7uJ D5UeXj08qVR8MwVMym9+1HdywPZqrSfP3NrBEly/F2n6Z/BuMaeWRAibPOI7sqZ+GjE4 Y09Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=Z5TvrXxN; 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 g19-20020a056402115300b004ab250bceecsi14872958edw.654.2023.03.22.10.16.14; Wed, 22 Mar 2023 10:16:38 -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=Z5TvrXxN; 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 S231178AbjCVQ6M (ORCPT + 99 others); Wed, 22 Mar 2023 12:58:12 -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 S230081AbjCVQ6K (ORCPT ); Wed, 22 Mar 2023 12:58:10 -0400 Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::227]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DE39719C6B for ; Wed, 22 Mar 2023 09:58:08 -0700 (PDT) Received: (Authenticated sender: miquel.raynal@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 5A95120007; Wed, 22 Mar 2023 16:58:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1679504287; 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=Z0DSwTWAElJZIp9DwGFl/1GywW/Rxfgdyjr2ORr+Pfg=; b=Z5TvrXxNV0wxhQzJOnIzKjpE6LYsWW6wTMX9cbWkLhE7diKjrxyRKV5JlleTj+fhND15Du lnKHDCpa4M2lYSvYzyOFkvLVKF9QWScA1heAIWiFyf3IkO4XeHmg+A1i4coeeCrcj06BM0 dcLFRHIZ56T4W/KUXQ2gyIFLPtx/uzmJponeFMx7gE41VVaVqK6B+2iGn76bT6UrSmRmnL HkfVcDYGWhDsuG29DNgOk6dYsnxU8TqQovB1bnw3HZUt+5XE0ZQfTEUj7F1otjNR/KdSbE bz6DPNNfDea20ED49KHhE12XmjhYI5cGUNSRlUvlqbYlYOjxdvNNn0gJBLDFXg== 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 1/4] nvmem: Add macro to register nvmem layout drivers Date: Wed, 22 Mar 2023 17:58:01 +0100 Message-Id: <20230322165804.2240285-2-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,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?1761089040394044929?= X-GMAIL-MSGID: =?utf-8?q?1761089053134452504?= 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 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/linux/nvmem-provider.h b/include/linux/nvmem-provider.h index 0cf9f9490514..3e97c8315c45 100644 --- a/include/linux/nvmem-provider.h +++ b/include/linux/nvmem-provider.h @@ -9,6 +9,7 @@ #ifndef _LINUX_NVMEM_PROVIDER_H #define _LINUX_NVMEM_PROVIDER_H +#include #include #include #include @@ -240,4 +241,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 22 16:58:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miquel Raynal X-Patchwork-Id: 73542 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp2460447wrt; Wed, 22 Mar 2023 10:15:42 -0700 (PDT) X-Google-Smtp-Source: AK7set9h+/6g/RApn7TezA8AQTFZiIwFXaB+Ver0H4t5tXNoaRkCorTuNs8D8jwNgtFyNzKzlQX5 X-Received: by 2002:a17:902:c651:b0:1a0:50bd:31c0 with SMTP id s17-20020a170902c65100b001a050bd31c0mr2754194pls.24.1679505341776; Wed, 22 Mar 2023 10:15:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679505341; cv=none; d=google.com; s=arc-20160816; b=kskvyCWYGjUrTkMSMcyBNxMK7W/zaN5YnfuIlv1JcD2WLvok2jgOxne8/Sb+9Jg4/b o6kpSStPLdHambt4x6KxFcXcd/sfZozMJh5Kwz1YoqFV4fjuQGcoB2DgRt7xw2vLF2Zz uKk2QYJ4dWx6K+IK+FYFf9FCZkMVh7MUJv7HFL4dZvWRkDemieOkP0aKeMjm32vu4XB9 DgUhQ68/EKLwU4U/rHNXTCClGn/MP15+qAHhpmrwLEYrWZjgxdoXUI/iqFuUwEIaeBkG J4IG4ZlfxxsSnpAFoYvTlzl+xVTAvv+ttauOB2UPLpnT2LzeJR/N8Pzp3Ivh2APE0kSs 3NJg== 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=G1do/+EN2p+5+PvMdLZ6x0R33OrVawbHTt7gEu3eRQ+MXuWtsEouowEfFMFPCKayWA 72brPn3Q3i+5FzyTGfS9JLdGJfHVk2FVChA3zbIm/01mkIJPPXyN2tp07kH1VCOO0gGa OHj2I9nq9kX83+sUzaYs2t7kxv8/NQjqK7e7ycjfsgUru1wuiKwns2pyBNFSSv21Qu/G tn8djLhwScv+zUcOgxUlMfbrYJjplK8fawxmK0+5JcjFxtP1aet5fZ3Rn42BPLKgEVGZ q4iSf2ATzcpmHU8omGjMk6R65hIXLu0y+w/yh6T3DFCecY0fpanOVavAHLiVsTWgU3Es hAVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=RrBp+8An; 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 h1-20020a170902748100b0019caa082cb5si16111510pll.399.2023.03.22.10.14.58; Wed, 22 Mar 2023 10:15:41 -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=RrBp+8An; 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 S231179AbjCVQ6O (ORCPT + 99 others); Wed, 22 Mar 2023 12:58:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43298 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230521AbjCVQ6K (ORCPT ); Wed, 22 Mar 2023 12:58:10 -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 8183216896 for ; Wed, 22 Mar 2023 09:58:09 -0700 (PDT) Received: (Authenticated sender: miquel.raynal@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 6622F20009; Wed, 22 Mar 2023 16:58:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1679504288; 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=RrBp+8AnozFWRI7Ebsi2JnY9XFrK357oc/ZwHII6pBd62JgMCW013M2PDzhT4RQRAplu3P Ne1WDN/m2fyO7SVUV9rnFc+xP8PHUZJqImVsH6cVqrVkddneIcxTN1iyFh0LLzdYG9Nh20 R1HmBcHPFGIFMXEo23QKkfSPMdXDNOE4KrJ9QuflYgbv4WPHzk8DpVV8Zktk9Mwn4fDeCe qhmdZ2Uq2VqFAc4xglVe7rfrr3NMzCWAHqVaQROtIzQnAIaeRRAzNXVTHi/9TwuQYBM1d8 1zPbMMLXPsMPKsGS4hjtRL0gcHnWL5ecwDmSwQhMnq7HjkMfX6BlFsBwTK4Hjg== 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 2/4] nvmem: layouts: sl28vpd: Use module_nvmem_layout_driver() Date: Wed, 22 Mar 2023 17:58:02 +0100 Message-Id: <20230322165804.2240285-3-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?1761088993372170432?= X-GMAIL-MSGID: =?utf-8?q?1761088993372170432?= 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 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 "); From patchwork Wed Mar 22 16:58:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miquel Raynal X-Patchwork-Id: 73532 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp2453508wrt; Wed, 22 Mar 2023 10:04:02 -0700 (PDT) X-Google-Smtp-Source: AK7set+Y6A9BKj8P3By71fG9C1xnZNitDr56u/dU/MZmquCz/eNG3KZ924gPwJOg90il5q8hKVyE X-Received: by 2002:a17:907:a090:b0:93b:68a8:a0e0 with SMTP id hu16-20020a170907a09000b0093b68a8a0e0mr3455342ejc.16.1679504642330; Wed, 22 Mar 2023 10:04:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679504642; cv=none; d=google.com; s=arc-20160816; b=xAEpHMvvOlduDl8bIo2m05+bCZPMgWq2yE9RkoitylW7ZNiNMf2X5yOPbnvsbR1TLX t509PTde8sjTwvT3MtnH9i1sbqhXJ1dLoBin1x+cUh8UOxFh9SxgZLFA8XODIzGcVpSe BS3w3+IQHyyFW4dOAr28nPHJmP9XEj8texOOL7kFKaU/Cbcw51AJUScPCnU3Nwmzm9r4 sIskVRSrnagjtMB+3zMmJ88SPLxCsk0wjA06cQ6JqX46brJtRD1BNtKFLyfZ/nekj3wz U1eRfexxBCEerLfvMfrB9Z3iRkBCK1LK0tfZzFIHcV6LSuH4cEjcLO4la1ZzBoqW7+AW RajQ== 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=XLlyaI4QMonkmTa5sgjZC0P9WGleknLmOHco+7zfOOiCNN4TEquxoTUkBlxXtAq1gc pjFl5iD4Ffz3beOx+ewx2va8ZRUk4QHbsI6cJuQE5PxdwqJtBgn1XM9lhiuyZNRRjb05 5ZD+4nEKc/IIguNDtMMfOZqw8E6qgHnM23Kh8cX8gNs0B2a1TvdjS9m3vikHXSGLgu1S CrQtCqkaCCrsRETLYeOfemWYGN6BsJE1Woi4M6LSZ+tIKEWZonNIDHlf5+MefPs+ifeR pOs7dH/gwxKyoPEvWQ+HFNgBzb474Fg/deV7OO3KRlBjkf8cfxkhjKcfaI9069v0nsdg b9dg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=RkglC9iE; 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 l3-20020aa7d943000000b004acda4c9666si15473554eds.225.2023.03.22.10.03.34; Wed, 22 Mar 2023 10:04:02 -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=RkglC9iE; 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 S231226AbjCVQ6W (ORCPT + 99 others); Wed, 22 Mar 2023 12:58:22 -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 S231180AbjCVQ6M (ORCPT ); Wed, 22 Mar 2023 12:58:12 -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 6678923847 for ; Wed, 22 Mar 2023 09:58:11 -0700 (PDT) Received: (Authenticated sender: miquel.raynal@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 6403F20008; Wed, 22 Mar 2023 16:58:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1679504290; 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=RkglC9iEarwf0gb7yLynF/Xk1XM9jP9Ah6S8B9jAROzFu61Rc/8hgokNhLDkvPB3Raw1bo vhNMU7OKr4mUWxX+rEEdXig/3rtCWrxZCQ3bnG8Q6NsDvhqFp9BjM17DaxoBtFyY351WwF GZs9S5qwH0mnQS1LdIl1Vor5oR9YD1oT26DeH3//2RgYqHdnEoOLxjINGuAOyorgOp++4o Yp8iGWh+Ir6ffCaXJJS/d5nR+j7xkNrTFoFv1b8C/pb+BUxUYF2cdmuzijdzKmmV7jwKhR XBkG37tWjrGNZ5IEDQqK60nbGm2xxt/Oo1nA4xpHF/w9Y6qunD/mAiYA2+NZiQ== 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 4/4] nvmem: layouts: onie-tlv: Drop wrong module alias Date: Wed, 22 Mar 2023 17:58:04 +0100 Message-Id: <20230322165804.2240285-5-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?1761088259675977812?= X-GMAIL-MSGID: =?utf-8?q?1761088259675977812?= 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");