Commit 0bfb8dd3 authored by Dan Williams's avatar Dan Williams

libnvdimm: cleanup nvdimm_namespace_common_probe(), kill 'host'

The 'host' variable can be killed as it is always the same as the passed
in device.
Reviewed-by: default avatarJohannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
parent 5a92289f
...@@ -1379,21 +1379,16 @@ struct nd_namespace_common *nvdimm_namespace_common_probe(struct device *dev) ...@@ -1379,21 +1379,16 @@ struct nd_namespace_common *nvdimm_namespace_common_probe(struct device *dev)
{ {
struct nd_btt *nd_btt = is_nd_btt(dev) ? to_nd_btt(dev) : NULL; struct nd_btt *nd_btt = is_nd_btt(dev) ? to_nd_btt(dev) : NULL;
struct nd_pfn *nd_pfn = is_nd_pfn(dev) ? to_nd_pfn(dev) : NULL; struct nd_pfn *nd_pfn = is_nd_pfn(dev) ? to_nd_pfn(dev) : NULL;
struct nd_namespace_common *ndns; struct nd_namespace_common *ndns = NULL;
resource_size_t size; resource_size_t size;
if (nd_btt || nd_pfn) { if (nd_btt || nd_pfn) {
struct device *host = NULL; if (nd_btt)
if (nd_btt) {
host = &nd_btt->dev;
ndns = nd_btt->ndns; ndns = nd_btt->ndns;
} else if (nd_pfn) { else if (nd_pfn)
host = &nd_pfn->dev;
ndns = nd_pfn->ndns; ndns = nd_pfn->ndns;
}
if (!ndns || !host) if (!ndns)
return ERR_PTR(-ENODEV); return ERR_PTR(-ENODEV);
/* /*
...@@ -1404,12 +1399,12 @@ struct nd_namespace_common *nvdimm_namespace_common_probe(struct device *dev) ...@@ -1404,12 +1399,12 @@ struct nd_namespace_common *nvdimm_namespace_common_probe(struct device *dev)
device_unlock(&ndns->dev); device_unlock(&ndns->dev);
if (ndns->dev.driver) { if (ndns->dev.driver) {
dev_dbg(&ndns->dev, "is active, can't bind %s\n", dev_dbg(&ndns->dev, "is active, can't bind %s\n",
dev_name(host)); dev_name(dev));
return ERR_PTR(-EBUSY); return ERR_PTR(-EBUSY);
} }
if (dev_WARN_ONCE(&ndns->dev, ndns->claim != host, if (dev_WARN_ONCE(&ndns->dev, ndns->claim != dev,
"host (%s) vs claim (%s) mismatch\n", "host (%s) vs claim (%s) mismatch\n",
dev_name(host), dev_name(dev),
dev_name(ndns->claim))) dev_name(ndns->claim)))
return ERR_PTR(-ENXIO); return ERR_PTR(-ENXIO);
} else { } else {
......
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