Commit f17ef495 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'char-misc-4.4-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc

Pull fpga driver fixes from Greg KH:
 "Only two small fpga driver fixes here, both have been in linux-next
  for a while, and resolve some reported issues"

* tag 'char-misc-4.4-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
  fpga manager: Fix firmware resource leak on error
  fpga manager: remove label
parents b24f74e3 e8c77bda
...@@ -122,12 +122,10 @@ int fpga_mgr_firmware_load(struct fpga_manager *mgr, u32 flags, ...@@ -122,12 +122,10 @@ int fpga_mgr_firmware_load(struct fpga_manager *mgr, u32 flags,
} }
ret = fpga_mgr_buf_load(mgr, flags, fw->data, fw->size); ret = fpga_mgr_buf_load(mgr, flags, fw->data, fw->size);
if (ret)
return ret;
release_firmware(fw); release_firmware(fw);
return 0; return ret;
} }
EXPORT_SYMBOL_GPL(fpga_mgr_firmware_load); EXPORT_SYMBOL_GPL(fpga_mgr_firmware_load);
...@@ -256,7 +254,6 @@ int fpga_mgr_register(struct device *dev, const char *name, ...@@ -256,7 +254,6 @@ int fpga_mgr_register(struct device *dev, const char *name,
void *priv) void *priv)
{ {
struct fpga_manager *mgr; struct fpga_manager *mgr;
const char *dt_label;
int id, ret; int id, ret;
if (!mops || !mops->write_init || !mops->write || if (!mops || !mops->write_init || !mops->write ||
...@@ -300,11 +297,9 @@ int fpga_mgr_register(struct device *dev, const char *name, ...@@ -300,11 +297,9 @@ int fpga_mgr_register(struct device *dev, const char *name,
mgr->dev.id = id; mgr->dev.id = id;
dev_set_drvdata(dev, mgr); 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); ret = device_add(&mgr->dev);
if (ret) if (ret)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment