Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.167.45 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795891234; b=qLy/S2QdmT+1P4urYcDCnsb/wJb8Ierxx11F6olaZbxNiHW/JXWNz8hFj/TSFfmEt8MD 34Kr6bLWWopceiuseU23BFyWyyf4SLVBL4nSugq9Jxw/F2Ddd0qKH6uZrGTG54HPH4zFI KeCzYaTWrzBzDzJfG/ddGf/UZOz4hzbE6UV+OF01YohdD6fIy6vZDE29iO+98aY1OFnPC DbDFE/uiKUU4WRhsWZ1cFcmuSboTDhTSxXR1FLslBsRHXKkgT9bIErX4u8Erko8Ih9a5q S8qXI907pRSwQHTMu9Ew7CZ6x74sAbGSP3QNCaNzRomX6rlz7Ul+KX5Y4juebCgGv2w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795891234; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References: MIME-Version:Content-Type:Content-Transfer-Encoding; bh=S5im5zZsg9hSKa7Tnkc7nybheTIwyT+Q+M6gk6oltmE=; b=ox1NF1j7Tp7R1ZGeEyF5j5La0VsejRs0RDw/W5H3xnnxHIEkS/5scfZhjB/7VXlXaO0t CaSTl3qfNQUoRr5ib30FUMc6yIXSqpWLq71I0iTAKv2khFXfR5H0/vq6J32D9w7vr2GMa WBebXp49A57UNN3rItdrw8kaijZZBTCK3hO889ZBESGzLCy7O/oBjLNZZAZ6TmZqTtf2E d3oH4QXObRgfcGPT8GCTBBKU4upBtiw14TGe8+JzE+ub/8clJcJ3VcpyFBoQsYnnAsNQu oqD6wvelMq7bGSlEpd9xlkLeUTcSYDRUPwD1ksO5pKDCHXXCa4HjeoN7yU5LioDElXg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=j6CN5YLt; arc=none smtp.remote-ip=209.85.167.45 Received: from mail-lf1-f45.google.com (mail-lf1-f45.google.com [209.85.167.45]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3FBC6606A31C for ; Sat, 28 Nov 2026 18:40:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 3FBC6606A31C Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=j6CN5YLt Received: by mail-lf1-f45.google.com with SMTP id 2adb3069b0e04-5c14f3dab09so4455190e87.0 for ; Sat, 28 Nov 2026 10:40:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1795891232; x=1796496032; darn=vger.kernel.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=S5im5zZsg9hSKa7Tnkc7nybheTIwyT+Q+M6gk6oltmE=; b=j6CN5YLti8TZYQNSHcZsGTACgWBcVm8RbeEBi3LpShEK98xffnvKVpCbZ3Ab7X9i+4 oTWHQ5WmVNDxMMGwYHpKEfgzHnAdOQG9cYMZZmy0RX8hE2Y+JDP4KGDjwsXLJEGZmqLi CfE9pOBXGznnCKo2tSjFs9cCtCkx++r0y+cFPM5bzsp3gDbEHGWo90MFn4Lr4lvwDjDv h/BIVIHu6OISyAcUxok290SAX1U5i9vcP78nf1Jiy3YyZQQUK8S2yfOKMRMitIFt93v+ b9rhWpjtDP685j3WTKK5mBwEbUStMjovZBg1PhkDFL3tG8rQQWC0LAtBT/Ky34ozfN6l rMMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1795891232; x=1796496032; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=S5im5zZsg9hSKa7Tnkc7nybheTIwyT+Q+M6gk6oltmE=; b=VAspGYJ4JrzUspo26QYZ1GTzJc3Ac4Vcg8Kf895SKkWRvuJql+Mk6JSXJTNizF1j8H p0I9PorpItal+q/cujD9lYrUP0MfrlrtIioShy36d2uIRRf0dRPSTrJf5sdTrFK2izsX Bvq/Jua2HZq2lZMzSy1pluGekyQuzB09qLICeo9dnij8edsGUoOq1r1c4OH+4oJlEVXA kkHPN6S1gAL3+7Ge9kXuDU74qCEmJkP4yM2w9U5XH1lU6u15EBKZMf2XU0Ne0HHge5SI m7z3XFpRqjHPKLgutN9ppCmQtAMHfEvDOt8BOhtrk2x/JRPuTvrmu2rowGsrMbnTus0N flww== X-Forwarded-Encrypted: i=1; AL+hErEsMmTqiFXToe5VV8CkU489bs7IborPNzLBno7WpBst/Jm8wTtN/95PhE7vWcUklrkpzhAyJS7jWFM=@vger.kernel.org X-Gm-Message-State: APuU4Z/+vnP0gCQNTovpcz3F+oxQvzSitDjHUCiooNYXGmKJ4fP+gnPY YYbDtosdwR+BlMZyb6I7lhTyfxF/1/vsAAgCOrmoxDDopZVNXEVpL4Ku X-Gm-Gg: AZFdTZfnSir1rq+8Qiww+gmFZiBRCaNHggk7JvDLNTmc4Ll8pBGtuHGWqf0lzjl1ZJI 8Gpay8M6bJ/+zxmvFJYjiedaj7R7kTnAFm8lEV837pgtwj1IaPSiFMEUWzu4zPTV7sPrMTHdwMB rLjjuqoJp1eCvph+aOVdGiI5+UB6gwGWDZVHPNANbFxvhbik/HgvVnU0UIg47wEDbNEkTSDkSpJ cROnWftXXzWy39WIajXWjLmYBRmKZ2SaebVsq5LJT6e7jYSZzbIxpWqCCH+2crCiFB4yAEMzefN rQxK4zU3ZsHUKS58v1UrimipGtDyA2Xv7Snd/A3vuqBJKrRs7pX6SGVWk3Gvz3AhpnTsrjb89XK NushDq/pj5WUhDAfPYQGVXbSOII+8rutcZ9AOaO8BRIOyu8qTtLNqt6xzZY99RSm8u0FwYrxNKH FBSkG+N6VPpN0tW++0nXelElUkvkzIBtHYNw1RFpIZtpU2WEjqpKIpfvE5q1Udlt88ElrkpiVJw anLE2OrEPuwytN81VY3Or6yXfS1MChI2F7oKGp/MohGPzZm0xrANkZJKJbD+JJqgvmyd6zzZYtj /Z/UTiAcHFrnJDzjk4k9Mr6gRtR8vnS7ldeB6XcPT+pAgMy4cWL5Hv0l9bexElhHWngiT+qqS+C AibKB/grvFn2NwG5Moibtd7tFLeWDu7ta0N4xXA== X-Received: by 2002:a05:6512:3a81:b0:5bf:b27e:3fac with SMTP id 2adb3069b0e04-5c1bc822487mr9877480e87.57.1795891232204; Sat, 28 Nov 2026 10:40:32 -0800 (PST) Received: from yantra.. (nekmmqv0jakeqhog8zq-1.v6.elisa-laajakaista.fi. [2001:99a:d7d:c300:c335:912f:e4f2:ad86]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5c1bcff8bc8sm7007006e87.20.2026.11.28.10.40.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Nov 2026 10:40:31 -0800 (PST) From: Rupesh Majhi To: Andy Shevchenko , Antoniu Miclaus , David Lechner , Eddie James , Jonathan Cameron , Lucas Stankus , Marcelo Schmitt , Michael Hennerich , =?UTF-8?q?Nuno=20S=C3=A1?= , Petre Rodan Cc: linux@analog.com, linux-iio@vger.kernel.org, Rupesh Majhi Subject: [PATCH v2 5/6] iio: adc: ina2xx-adc: use iio_debugfs_reg_access_regmap() Date: Sat, 28 Nov 2026 20:40:24 +0200 Message-ID: <20261128184025.87548-6-zoone.rupert@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20261128184025.87548-1-zoone.rupert@gmail.com> References: <20261128184025.87548-1-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=UTF-8 Content-Transfer-Encoding: 8bit The debugfs callback only reads or writes the regmap of the parent device, which is what the core helper does. Reviewed-by: Nuno Sá Signed-off-by: Rupesh Majhi --- drivers/iio/adc/ina2xx-adc.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/drivers/iio/adc/ina2xx-adc.c b/drivers/iio/adc/ina2xx-adc.c index c412f5ed46a1..587e82c33454 100644 --- a/drivers/iio/adc/ina2xx-adc.c +++ b/drivers/iio/adc/ina2xx-adc.c @@ -895,17 +895,6 @@ static const struct iio_buffer_setup_ops ina2xx_setup_ops = { .predisable = &ina2xx_buffer_disable, }; -static int ina2xx_debug_reg(struct iio_dev *indio_dev, - unsigned reg, unsigned writeval, unsigned *readval) -{ - struct ina2xx_chip_info *chip = iio_priv(indio_dev); - - if (!readval) - return regmap_write(chip->regmap, reg, writeval); - - return regmap_read(chip->regmap, reg, readval); -} - /* Possible integration times for vshunt and vbus */ static IIO_CONST_ATTR_NAMED(ina219_integration_time_available, integration_time_available, @@ -950,14 +939,14 @@ static const struct iio_info ina219_info = { .read_raw = ina2xx_read_raw, .read_avail = ina2xx_read_avail, .write_raw = ina2xx_write_raw, - .debugfs_reg_access = ina2xx_debug_reg, + .debugfs_reg_access = iio_debugfs_reg_access_regmap, }; static const struct iio_info ina226_info = { .attrs = &ina226_attribute_group, .read_raw = ina2xx_read_raw, .write_raw = ina2xx_write_raw, - .debugfs_reg_access = ina2xx_debug_reg, + .debugfs_reg_access = iio_debugfs_reg_access_regmap, }; /* Initialize the configuration and calibration registers. */ -- 2.43.0