On Wed, Jun 03, 2026 at 07:02:30PM +0000, sashiko-bot@kernel.org wrote: > Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider: > - [High] The HX710B driver fails to request and enable the `avdd-supply` and `dvdd-supply` regulators, leaving the chip unpowered. > - [Low] The driver uses a non-existent compiler macro `__counted_by_ptr`, which will cause a build failure. > -- > > commit 4a57ad17002849c3ffed8137401cf0ed7fd81778 > Author: Piyush Patle > > iio: adc: hx711: add support for HX710B > > This commit adds support for the AVIA HX710B ADC, sharing the GPIO interface > with the HX711 but using trailing pulses for mode selection. It introduces > variant-specific channel configurations and tracks active channels across > conversions. Additionally, it refactors the gain and scale computations to > use fixed values for the new variant. Sashiko is replying here to the wrong patch. > > > diff --git a/drivers/iio/adc/hx711.c b/drivers/iio/adc/hx711.c > > index 5c326f01c5543..e90780dfd34e5 100644 > > --- a/drivers/iio/adc/hx711.c > > +++ b/drivers/iio/adc/hx711.c > > @@ -84,12 +86,16 @@ static int hx711_get_scale_to_gain(const int *gain_scale, int scale) > > * @channels: channel specification array > > * @num_channels: number of entries in @channels > > * @iio_info: IIO info ops for this variant > > + * @fixed_gain_val: fixed PGA gain (used when @has_fixed_gain is true) > > + * @has_fixed_gain: true if the variant has a fixed ADC gain > > */ > > struct hx711_chip_info { > > const char *name; > > const struct iio_chan_spec *channels __counted_by_ptr(num_channels); > > [Severity: Low] > Will this compile? The __counted_by_ptr macro doesn't appear to be defined > anywhere in the kernel, whereas __counted_by is used for flexible array > members. Could this result in a syntax error during the build? > > > unsigned int num_channels; > > const struct iio_info *iio_info; > > + unsigned int fixed_gain_val; > > + bool has_fixed_gain; > > }; > > [ ... ] > > > @@ -543,32 +709,43 @@ static int hx711_probe(struct platform_device *pdev) > > return dev_err_probe(dev, PTR_ERR(hx711_data->gpiod_dout), > > "failed to get dout-gpiod\n"); > > > > - ret = devm_regulator_get_enable_read_voltage(dev, "avdd"); > > + if (chip_info->has_fixed_gain) > > + ret = devm_regulator_get_enable_read_voltage(dev, "vref"); > > + else > > + ret = devm_regulator_get_enable_read_voltage(dev, "avdd"); > > if (ret < 0) > > return ret; > > [Severity: High] > Does this leave the HX710B unpowered? The device tree bindings require > both avdd-supply and dvdd-supply for the avia,hx710b compatible. > > However, when has_fixed_gain is true for the HX710B variant, the driver > only requests the vref supply. If avdd and dvdd are controlled by actual > regulators on the board, will they remain disabled and cause the hardware > to fail? > > -- > Sashiko AI review · https://sashiko.dev/#/patchset/20260603184859.89693-1-piyushpatle228@gmail.com?part=4