Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=192.198.163.6 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796409333; b=3kMgUcErgeGmyDKecm35UZiyWfrjm4YxdfAEs/P647ALBFCEnaSMaFgxuiLwymTo1ORO N3rqwWDYeAE11MC/hQTYr2NLAJUcddkHg6zO+hD2tsxQWW+pKfL0GaikaY2xn0Cln6r7z phSyYNkzE7K2a92OG7Rq/G97DuGRPLn3Ss7pyJ2M+hvQN88b/B6rRVOk1R1qzRnPS9gPd gy0BtqWR49uxLSAxNtMLTEKTaTLwzeIU+x2xuCk0PN2zumptCF93JHJcGs+YiVP6/sNEU CpP7N6Da1pLv3K03jVRIR+RG3XodkGPe6RrCa+jVv8kgLpW0jbsKjB8hAVFe7Zsj2sw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796409333; h=DMARC-Filter:DKIM-Signature:X-CSE-ConnectionGUID:X-CSE-MsgGUID: X-IronPort-AV:X-IronPort-AV:Received:X-CSE-ConnectionGUID: X-CSE-MsgGUID:X-ExtLoop1:X-IronPort-AV:Received:Date:From:To:Cc: Subject:Message-ID:References:MIME-Version:Content-Type: Content-Disposition:In-Reply-To:Organization; bh=9O6kBOY0pUzoj3DBvosT0s1oIkEMN8SVJId7GUtYJHc=; b=3GdhA2KIVqmnNx1QyGRyCQqem/OX6S/fgj7yGvVBc7nPLN6yfglGn6lwlcWeUrTHEJr0 7LS1tC/a01X78OCq2AcNG3Cah+7VePtS3Y0g6rM++LzBg00W+ix9/yo5ofJjrKqpb2MrL OH3itg39l+dYc+3uz2gohJlq8DqAhk3ZNskp7m2Xv6ThiIvIWHb83xpYrPjwmuqM9MNWE iYOMkeL9zArg+r9VZlEdYKh5WBDHe3XH2gZzNs1f+l+RVPUvLwki7DJEGBKmEDM5rXwxr 3yD2Gd3Upbh500TZw3J0jXGsvbAIVFSzDb80TicH9/pn1fZnQk7FJ1EdVvbVz76OGxg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=SqP2YBpy; arc=none smtp.remote-ip=192.198.163.6 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.6]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 798CB606A32C for ; Fri, 4 Dec 2026 18:35:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 798CB606A32C Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=SqP2YBpy DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1796409333; x=1827945333; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=u2cABQhFFGHBlefLS+NOB2SB6JC9WemczgVW6EtlgJc=; b=SqP2YBpyzjahFVFa6nmaNXOhsCYqAOBxv2EUiMDt9YJnmqm6AVznU/an koKIU2mX9H49kib2Z57+OT3gLU0vPq4n5v/2+YKSKcagwui7GSyZYjG2a OhZ3q8R5petsiRR4P+WPd0d7OGpnmc8wQrcvpMaTGs0tUFq9dDy65cW+K poB7HoHSZ9u2sGjPfEr6GjS4RmIVCK9Y9LoDAjHpE9KhQzeKMAgVFM75j t+t2+o+UL+CcRnaoOhyufF0fi/MD2jQE1x6PHucYOFglGlRiewcByGG53 6g72deMbNj1SFvkNYnjRPljyaF5NrZ3I8lSS0rP4Vg7p5SZBvNORbhm0h A==; X-CSE-ConnectionGUID: cc+pemyoTRGUfD2HQWrkqA== X-CSE-MsgGUID: jiPn/cx1QYCo8NaNhJ1Icg== X-IronPort-AV: E=McAfee;i="6800,10657,11986"; a="19544" X-IronPort-AV: E=Sophos;i="6.29,78,1794902400"; d="scan'208";a="19544" Received: from orviesa003.jf.intel.com ([10.64.159.143]) by fmvoesa116.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Dec 2026 10:35:31 -0800 X-CSE-ConnectionGUID: fvfyUmdERL2TtBRh7dKIbg== X-CSE-MsgGUID: 7XI02HR/SXGgiLLjvn/nNA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.29,78,1794902400"; d="scan'208";a="14009607" Received: from alekseim-mobl.ger.corp.intel.com (HELO localhost) ([10.245.245.10]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Dec 2026 10:35:27 -0800 Date: Fri, 4 Dec 2026 20:35:24 +0200 From: Andy Shevchenko To: Rupesh Majhi Cc: Andy Shevchenko , Antoniu Miclaus , David Lechner , Eddie James , Jonathan Cameron , Lucas Stankus , Marcelo Schmitt , Michael Hennerich , Nuno =?iso-8859-1?Q?S=E1?= , Petre Rodan , linux@analog.com, linux-iio@vger.kernel.org, crofts@kernel.org Subject: Re: [PATCH v3 1/6] iio: core: add iio_access_debugfs_regmap_reg() Message-ID: References: <20261204181105.150419-1-zoone.rupert@gmail.com> <20261204181105.150419-2-zoone.rupert@gmail.com> X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20261204181105.150419-2-zoone.rupert@gmail.com> Organization: Intel Finland Oy - BIC 0357606-4 - c/o Alberga Business Park, 6 krs, Bertel Jungin Aukio 5, 02600 Espoo On Fri, Dec 04, 2026 at 08:11:00PM +0200, Rupesh Majhi wrote: > More than 25 drivers implement .debugfs_reg_access() with only a > regmap_read() or regmap_write() on the regmap of the parent device. > Add a helper that looks that regmap up with dev_get_regmap(), so these > drivers can drop their own copy. > > Without CONFIG_DEBUG_FS the helper is defined as NULL, like > adis_debugfs_reg_access(), so drivers can use it without ifdefs. > - kernel-doc of iio_get_debugfs_dentry() moves inside the #if, so the > new prototype can share the block; kernel-doc output is unchanged (Andy) Just to be sure, you checked kernel-doc render of the file, but would it be possible to check the sphynx generated documentation? I believe it should not be dependent on the CONFIG_DEBUG_FS=n. ... > +int iio_access_debugfs_regmap_reg(struct iio_dev *indio_dev, unsigned int reg, > + unsigned int writeval, unsigned int *readval) > +{ > + struct regmap *map = dev_get_regmap(indio_dev->dev.parent, NULL); > + Split the assignment, it would be easier to maintain. > + if (!map) > + return -ENODEV; struct regmap *map; map = dev_get_regmap(indio_dev->dev.parent, NULL); if (!map) return -ENODEV; > + if (readval) > + return regmap_read(map, reg, readval); > + > + return regmap_write(map, reg, writeval); > +} ... > +#if defined(CONFIG_DEBUG_FS) > /** > * iio_get_debugfs_dentry() - helper function to get the debugfs_dentry > * @indio_dev: IIO device structure for device > **/ TBH, I don't understand why kernel-doc is even here. More I think about it more I believe it should be simply moved to the respective C-file. > -#if defined(CONFIG_DEBUG_FS) > struct dentry *iio_get_debugfs_dentry(struct iio_dev *indio_dev); -- With Best Regards, Andy Shevchenko