Skip to contentSkip to conversation

fpga manager: remove label

PATCH In review [email protected] 3 participants 3 messages Oct 29, 2015 FPGA manager framework

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fpga manager: remove label

From: Alan Tull <[email protected]>

Remove implementation of 'label' DT binding.

---
 drivers/fpga/fpga-mgr.c |    9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
drivers/fpga/fpga-mgr.c +3 -6
index 45c41cb..f747311 100644
@@ -257,7 +257,6 @@ int fpga_mgr_register(struct device *dev, const char *name,
 		      void *priv)
 {
 	struct fpga_manager *mgr;
-	const char *dt_label;
 	int id, ret;
 
 	if (!mops || !mops->write_init || !mops->write ||
@@ -305,11 +304,9 @@ int fpga_mgr_register(struct device *dev, const char *name,
 	mgr->dev.id = id;
 	dev_set_drvdata(dev, mgr);
 
-	dt_label = of_get_property(mgr->dev.of_node, "label", NULL);
-	if (dt_label)
-		ret = dev_set_name(&mgr->dev, "%s", dt_label);
-	else
-		ret = dev_set_name(&mgr->dev, "fpga%d", id);
+	ret = dev_set_name(&mgr->dev, "fpga%d", id);
+	if (ret)
+		goto error_device;
 
 	ret = device_add(&mgr->dev);
 	if (ret)
Signature · 1 line
1.7.9.5
Reviewed-by on v1 1/1
#1 lore raw
Quoted 37 lines · On Thu, Oct 29, 2015 at 12:39 PM, <[email protected]> wrote:

From: Alan Tull <[email protected]>

Remove implementation of 'label' DT binding.

---
 drivers/fpga/fpga-mgr.c |    9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
drivers/fpga/fpga-mgr.c +3 -7
index 45c41cb..f747311 100644
@@ -257,7 +257,6 @@ int fpga_mgr_register(struct device *dev, const char *name,
                      void *priv)
 {
        struct fpga_manager *mgr;
-       const char *dt_label;
        int id, ret;
 
        if (!mops || !mops->write_init || !mops->write ||
@@ -305,11 +304,9 @@ int fpga_mgr_register(struct device *dev, const char *name,
        mgr->dev.id = id;
        dev_set_drvdata(dev, mgr);
 
-       dt_label = of_get_property(mgr->dev.of_node, "label", NULL);
-       if (dt_label)
-               ret = dev_set_name(&mgr->dev, "%s", dt_label);
-       else
-               ret = dev_set_name(&mgr->dev, "fpga%d", id);
+       ret = dev_set_name(&mgr->dev, "fpga%d", id);
+       if (ret)
+               goto error_device;
 
        ret = device_add(&mgr->dev);
        if (ret)
--
Quoted 2 lines

1.7.9.5

I had never used the if (dt_label) path, so the else path is pretty well tested ;-)

Cheers,

Moritz