Re: [PATCH 3/5] iio: proximity: hx9023s: support firmware-name property

From: Andy Shevchenko

Date: Mon Feb 09 2026 - 03:50:57 EST


On Mon, Feb 09, 2026 at 11:37:04AM +0800, Yasin Lee wrote:
> Add an optional firmware-name property to specify the firmware file.
> If not provided, the driver falls back to the default firmware name.

...

> struct device *dev = &client->dev;
> struct iio_dev *indio_dev;
> struct hx9023s_data *data;

> + const char *fw_name = "hx9023s.bin";

Preserve reversed xmas tree order.
And looking at the usage, please split the definition and assignment.

> int ret;

...

> + ret = device_property_read_string(dev, "firmware-name", &fw_name);
> + if (ret && ret != -EINVAL)

Why is this special error code check?

> + return dev_err_probe(dev, ret, "failed to read firmware-name\n");

fw_name = "...";
device_property_read_string(dev, "firmware-name", &fw_name);

I believe if wondering one can get a debug information from
request_firmware_nowait() on what firmware file has been actually used.

--
With Best Regards,
Andy Shevchenko