watchdog: dm: Change uclass name to watchdog and enable DM_UC_FLAG_SEQ_ALIAS
authorMichal Simek <michal.simek@xilinx.com>
Wed, 11 Jul 2018 06:24:43 +0000 (08:24 +0200)
committerMichal Simek <michal.simek@xilinx.com>
Thu, 19 Jul 2018 08:49:54 +0000 (10:49 +0200)
uclass name is used by dev_read_alias_seq which return seq number when
aliases are used.

Code fragment:
168 int dev_read_alias_seq(struct udevice *dev, int *devnump)
169 {
170         ofnode node = dev_ofnode(dev);
171         const char *uc_name = dev->uclass->uc_drv->name;
172         int ret;
173
174         if (ofnode_is_np(node)) {
175                 ret = of_alias_get_id(ofnode_to_np(node), uc_name);

Also this patch enables DM_UC_FLAG_SEQ_ALIAS to be in sync with Linux
which is also using watchdog name for watchdog aliases.

drivers/watchdog/watchdog_core.c:215:
 ret = of_alias_get_id(wdd->parent->of_node, "watchdog");

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
drivers/watchdog/wdt-uclass.c

index 4a619f71fe910b7a18c6e37d7f0fe13e37423c91..f6f2fe3739d3e1719c0433460d9be83d192c04b4 100644 (file)
@@ -65,5 +65,6 @@ int wdt_expire_now(struct udevice *dev, ulong flags)
 
 UCLASS_DRIVER(wdt) = {
        .id             = UCLASS_WDT,
-       .name           = "wdt",
+       .name           = "watchdog",
+       .flags          = DM_UC_FLAG_SEQ_ALIAS,
 };