Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp8960065rwl; Tue, 10 Jan 2023 22:50:16 -0800 (PST) X-Google-Smtp-Source: AMrXdXuxhRRrLgTkQP3S7QY8o0uPCGUaWoP/iyOl6EJGqmQqhPpVwXfsCRzR+BcxZMm0uguDSU7p X-Received: by 2002:a17:907:d601:b0:7c1:2d36:d11a with SMTP id wd1-20020a170907d60100b007c12d36d11amr69455448ejc.11.1673419816795; Tue, 10 Jan 2023 22:50:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673419816; cv=none; d=google.com; s=arc-20160816; b=allGplEu3g5yhLxIe7or7w+NjAuEC69Yh+XllcFxhbr5EFKuRha6B3j4yDzp6h+4Pl aTpruG6Q9g9u0MBXh85XE7lbvi3ncbll1c/7ZPgqaZjhWywWfbNG5mCiEZSidtLT0A5D 5wATYQrmG3HLhoXCmGbdXsEsO0S5FWUy38hAXYCb7B+U87jKGOkJ8tMvmPE3VHgUN8oZ s619GYmDfdnEE0o2MrlMMr3GDfGQNkMfMyO2MzCUl9NmycF9uag1ETD0KALuqrtM1GM1 gTOOFRX0NYcfaGfwPvrT7/WCDqfx0YkiAOnbC+Jz/R6CsmsJVQ96QA/ubeYF/ktpNn7t /pxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=COYrkLSv3jdS3lJ0kkpjmYA7+oZevaDBnEPefJ6iaMo=; b=JItI09LIml/5ojQS9PBoWOofHXVuImwJm5PRLOuYtDZRbdzL07mVeOmm7vNnLjrV8h LGuqI0BsFQV2DfSOoOSmLit9Lt61kAnScXAqz4TwsuqtaXCEoVHQipOYO2+La8pqj/6L iY7AWg6xKjeQ8rqrb6SJXxBpAcVxSPQXpsq5D/OSUqZ1B391uQtOmZNQomnvn4NMjjn8 gUIEB5Tws9j7aChvSXIbEeAYVPZpUbB+TVicNHut2qH6n3lKbPsmh0Qz+zhRneXjZ7yf MY3LX1ZNo4NbV+pvFtFtQUi4KuEgl8bF81Ynfuva3UJcGJBeVqe7mp7tZgQLyEpxVCkU ALeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=spNlNLqW; 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=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sc18-20020a1709078a1200b007acbac0871csi14170787ejc.420.2023.01.10.22.50.03; Tue, 10 Jan 2023 22:50:16 -0800 (PST) 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=@linuxfoundation.org header.s=korg header.b=spNlNLqW; 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=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231779AbjAKG0P (ORCPT + 55 others); Wed, 11 Jan 2023 01:26:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42190 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230313AbjAKG0B (ORCPT ); Wed, 11 Jan 2023 01:26:01 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B248D10A3 for ; Tue, 10 Jan 2023 22:25:58 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id A08F4B81B2B for ; Wed, 11 Jan 2023 06:25:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 857D2C433D2; Wed, 11 Jan 2023 06:25:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1673418355; bh=bzVrjVDU74N7h6Xob+7BH0CWSxDE9OMpqjosSxxpP9Y=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=spNlNLqWRYOS5IrMrM80Dkv0npb6NuwxJZrwYYI57rYK3IEE3Q+CQ0avuXHWGiN38 NuetdYxiQNHVla0HJ0jxWXRSc11uGZhmddsoYyxS6JoSydZnHIvAQGBDb5c0p3nNlQ qmvVAewB/s0/IbiNeE3AtKn5ZNo4cBctpdJiMSJE= Date: Wed, 11 Jan 2023 07:25:51 +0100 From: Greg Kroah-Hartman To: Li Chen Cc: "Rafael J. Wysocki" , linux-kernel@vger.kernel.org Subject: Re: [PATCH] debugfs: allow to use regmap for print regs Message-ID: References: <20230111061541.3657154-1-me@linux.beauty> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230111061541.3657154-1-me@linux.beauty> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 On Wed, Jan 11, 2023 at 02:15:41PM +0800, Li Chen wrote: > Currently, debugfs_regset32 only contains void __iomem *base, > and it is not friendly to regmap user. > > Let's add regmap to debugfs_regset32, and add regmap > support to debugfs_print_reg32. > > Signed-off-by: Li Chen > --- > fs/debugfs/file.c | 23 +++++++++++++++++++---- > include/linux/debugfs.h | 10 +++++++--- > 2 files changed, 26 insertions(+), 7 deletions(-) > > diff --git a/fs/debugfs/file.c b/fs/debugfs/file.c > index b54f470e0d03..c4663cfc20b6 100644 > --- a/fs/debugfs/file.c > +++ b/fs/debugfs/file.c > @@ -1112,8 +1112,10 @@ EXPORT_SYMBOL_GPL(debugfs_create_u32_array); > * @regs: an array if struct debugfs_reg32 structures > * @nregs: the length of the above array > * @base: the base address to be used in reading the registers > + * @regmap: regmap to be used in reading the registers > * @prefix: a string to be prefixed to every output line > * > + * user should pick one of two from base and regmap > * This function outputs a text block describing the current values of > * some 32-bit hardware registers. It is meant to be used within debugfs > * files based on seq_file that need to show registers, intermixed with other > @@ -1122,15 +1124,27 @@ EXPORT_SYMBOL_GPL(debugfs_create_u32_array); > * for example configuration of dma channels > */ > void debugfs_print_regs32(struct seq_file *s, const struct debugfs_reg32 *regs, > - int nregs, void __iomem *base, char *prefix) > + int nregs, void __iomem *base, struct regmap *regmap, > + char *prefix) This is confusing, please just provide a new function for regmap instead of trying to overload this function. You can use the same function inside the debugfs core like this, but never export such a complex set of parameters to actual users, that's just painful. thanks, greg k-h