mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-09-30 08:30:50 +09:00
gpio: dw: Add a trailing underscore to generated name
Previously, if there was no bank-name property, it was easy to have confusing gpio names like "gpio1@08", instead of "gpio1@0_8". This patch follows the example of the sifive gpio driver. Signed-off-by: Sean Anderson <seanga2@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
af551daf9e
commit
18dbb7b335
@ -186,7 +186,15 @@ static int gpio_dwapb_bind(struct udevice *dev)
|
|||||||
* Fall back to node name. This means accessing pins
|
* Fall back to node name. This means accessing pins
|
||||||
* via bank name won't work.
|
* via bank name won't work.
|
||||||
*/
|
*/
|
||||||
plat->name = ofnode_get_name(node);
|
char name[32];
|
||||||
|
|
||||||
|
snprintf(name, sizeof(name), "%s_",
|
||||||
|
ofnode_get_name(node));
|
||||||
|
plat->name = strdup(name);
|
||||||
|
if (!plat->name) {
|
||||||
|
kfree(plat);
|
||||||
|
return -ENOMEM;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = device_bind_ofnode(dev, dev->driver, plat->name,
|
ret = device_bind_ofnode(dev, dev->driver, plat->name,
|
||||||
|
Loading…
Reference in New Issue
Block a user