summaryrefslogtreecommitdiffstats
path: root/drivers/nvdimm
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2016-04-13 20:06:48 -0400
committerDan Williams <dan.j.williams@intel.com>2016-04-22 15:26:24 -0400
commit0bfb8dd3edd6e423b5053c86e10c97e92cf205ea (patch)
treefcd904c8870db5c1822916d7b2afb1e372c19f56 /drivers/nvdimm
parent5a92289f41311a54ededb5e4ed474cc38f5d85de (diff)
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: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/nvdimm')
-rw-r--r--drivers/nvdimm/namespace_devs.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/drivers/nvdimm/namespace_devs.c b/drivers/nvdimm/namespace_devs.c
index f5cb88601359..e5ad5162bf34 100644
--- a/drivers/nvdimm/namespace_devs.c
+++ b/drivers/nvdimm/namespace_devs.c
@@ -1379,21 +1379,16 @@ struct nd_namespace_common *nvdimm_namespace_common_probe(struct device *dev)
1379{ 1379{
1380 struct nd_btt *nd_btt = is_nd_btt(dev) ? to_nd_btt(dev) : NULL; 1380 struct nd_btt *nd_btt = is_nd_btt(dev) ? to_nd_btt(dev) : NULL;
1381 struct nd_pfn *nd_pfn = is_nd_pfn(dev) ? to_nd_pfn(dev) : NULL; 1381 struct nd_pfn *nd_pfn = is_nd_pfn(dev) ? to_nd_pfn(dev) : NULL;
1382 struct nd_namespace_common *ndns; 1382 struct nd_namespace_common *ndns = NULL;
1383 resource_size_t size; 1383 resource_size_t size;
1384 1384
1385 if (nd_btt || nd_pfn) { 1385 if (nd_btt || nd_pfn) {
1386 struct device *host = NULL; 1386 if (nd_btt)
1387
1388 if (nd_btt) {
1389 host = &nd_btt->dev;
1390 ndns = nd_btt->ndns; 1387 ndns = nd_btt->ndns;
1391 } else if (nd_pfn) { 1388 else if (nd_pfn)
1392 host = &nd_pfn->dev;
1393 ndns = nd_pfn->ndns; 1389 ndns = nd_pfn->ndns;
1394 }
1395 1390
1396 if (!ndns || !host) 1391 if (!ndns)
1397 return ERR_PTR(-ENODEV); 1392 return ERR_PTR(-ENODEV);
1398 1393
1399 /* 1394 /*
@@ -1404,12 +1399,12 @@ struct nd_namespace_common *nvdimm_namespace_common_probe(struct device *dev)
1404 device_unlock(&ndns->dev); 1399 device_unlock(&ndns->dev);
1405 if (ndns->dev.driver) { 1400 if (ndns->dev.driver) {
1406 dev_dbg(&ndns->dev, "is active, can't bind %s\n", 1401 dev_dbg(&ndns->dev, "is active, can't bind %s\n",
1407 dev_name(host)); 1402 dev_name(dev));
1408 return ERR_PTR(-EBUSY); 1403 return ERR_PTR(-EBUSY);
1409 } 1404 }
1410 if (dev_WARN_ONCE(&ndns->dev, ndns->claim != host, 1405 if (dev_WARN_ONCE(&ndns->dev, ndns->claim != dev,
1411 "host (%s) vs claim (%s) mismatch\n", 1406 "host (%s) vs claim (%s) mismatch\n",
1412 dev_name(host), 1407 dev_name(dev),
1413 dev_name(ndns->claim))) 1408 dev_name(ndns->claim)))
1414 return ERR_PTR(-ENXIO); 1409 return ERR_PTR(-ENXIO);
1415 } else { 1410 } else {