Skip to content

Commit 1fc378f

Browse files
robherringJonathan Cameron
authored andcommitted
iio: Convert to using %pOFn instead of device_node.name
In preparation to remove the node name pointer from struct device_node, convert printf users to use the %pOFn format specifier. Cc: Jonathan Cameron <jic23@kernel.org> Cc: Hartmut Knaack <knaack.h@gmx.de> Cc: Lars-Peter Clausen <lars@metafoo.de> Cc: linux-iio@vger.kernel.org Signed-off-by: Rob Herring <robh@kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
1 parent 1e46774 commit 1fc378f

3 files changed

Lines changed: 9 additions & 9 deletions

File tree

‎drivers/iio/adc/qcom-pm8xxx-xoadc.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -708,8 +708,8 @@ static int pm8xxx_of_xlate(struct iio_dev *indio_dev,
708708
* mux.
709709
*/
710710
if (iiospec->args_count != 2) {
711-
dev_err(&indio_dev->dev, "wrong number of arguments for %s need 2 got %d\n",
712-
iiospec->np->name,
711+
dev_err(&indio_dev->dev, "wrong number of arguments for %pOFn need 2 got %d\n",
712+
iiospec->np,
713713
iiospec->args_count);
714714
return -EINVAL;
715715
}

‎drivers/iio/adc/rcar-gyroadc.c‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -343,8 +343,8 @@ static int rcar_gyroadc_parse_subdevs(struct iio_dev *indio_dev)
343343
for_each_child_of_node(np, child) {
344344
of_id = of_match_node(rcar_gyroadc_child_match, child);
345345
if (!of_id) {
346-
dev_err(dev, "Ignoring unsupported ADC \"%s\".",
347-
child->name);
346+
dev_err(dev, "Ignoring unsupported ADC \"%pOFn\".",
347+
child);
348348
continue;
349349
}
350350

@@ -381,16 +381,16 @@ static int rcar_gyroadc_parse_subdevs(struct iio_dev *indio_dev)
381381
ret = of_property_read_u32(child, "reg", &reg);
382382
if (ret) {
383383
dev_err(dev,
384-
"Failed to get child reg property of ADC \"%s\".\n",
385-
child->name);
384+
"Failed to get child reg property of ADC \"%pOFn\".\n",
385+
child);
386386
return ret;
387387
}
388388

389389
/* Channel number is too high. */
390390
if (reg >= num_channels) {
391391
dev_err(dev,
392-
"Only %i channels supported with %s, but reg = <%i>.\n",
393-
num_channels, child->name, reg);
392+
"Only %i channels supported with %pOFn, but reg = <%i>.\n",
393+
num_channels, child, reg);
394394
return ret;
395395
}
396396
}

‎drivers/iio/frequency/adf4350.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ static struct adf4350_platform_data *adf4350_parse_dt(struct device *dev)
388388
if (!pdata)
389389
return NULL;
390390

391-
strncpy(&pdata->name[0], np->name, SPI_NAME_SIZE - 1);
391+
snprintf(&pdata->name[0], SPI_NAME_SIZE - 1, "%pOFn", np);
392392

393393
tmp = 10000;
394394
of_property_read_u32(np, "adi,channel-spacing", &tmp);

0 commit comments

Comments
 (0)