mirror of
https://github.com/torvalds/linux.git
synced 2026-05-31 18:43:33 +02:00
iio: proximity: hx9023s: support firmware-name property
Add an optional firmware-name property to specify the firmware file. If not provided, the driver falls back to the default firmware name. Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Signed-off-by: Yasin Lee <yasin.lee.x@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
parent
577fe2fdd4
commit
8e901c49ff
|
|
@ -1086,6 +1086,7 @@ static int hx9023s_probe(struct i2c_client *client)
|
|||
struct device *dev = &client->dev;
|
||||
struct iio_dev *indio_dev;
|
||||
struct hx9023s_data *data;
|
||||
const char *fw_name;
|
||||
int ret;
|
||||
|
||||
indio_dev = devm_iio_device_alloc(dev, sizeof(*data));
|
||||
|
|
@ -1123,7 +1124,9 @@ static int hx9023s_probe(struct i2c_client *client)
|
|||
if (ret)
|
||||
return dev_err_probe(dev, ret, "channel config failed\n");
|
||||
|
||||
ret = request_firmware_nowait(THIS_MODULE, true, "hx9023s.bin", dev,
|
||||
fw_name = "hx9023s.bin";
|
||||
device_property_read_string(dev, "firmware-name", &fw_name);
|
||||
ret = request_firmware_nowait(THIS_MODULE, true, fw_name, dev,
|
||||
GFP_KERNEL, data, hx9023s_cfg_update);
|
||||
if (ret)
|
||||
return dev_err_probe(dev, ret, "reg config failed\n");
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user