pmem.c (cecdd52a3dd312564f81a39df08378b7b39a2654) | pmem.c (d35b495ddf92c964eedf2ac86fdbf88dc3e5cbc9) |
---|---|
1// SPDX-License-Identifier: GPL-2.0-only 2/* Copyright(c) 2020 Intel Corporation. */ 3#include <linux/device.h> 4#include <linux/slab.h> 5#include <linux/idr.h> 6#include <cxlmem.h> 7#include <cxl.h> 8#include "core.h" --- 48 unchanged lines hidden (view full) --- 57} 58EXPORT_SYMBOL_NS_GPL(is_cxl_nvdimm_bridge, CXL); 59 60static int match_nvdimm_bridge(struct device *dev, void *data) 61{ 62 return is_cxl_nvdimm_bridge(dev); 63} 64 | 1// SPDX-License-Identifier: GPL-2.0-only 2/* Copyright(c) 2020 Intel Corporation. */ 3#include <linux/device.h> 4#include <linux/slab.h> 5#include <linux/idr.h> 6#include <cxlmem.h> 7#include <cxl.h> 8#include "core.h" --- 48 unchanged lines hidden (view full) --- 57} 58EXPORT_SYMBOL_NS_GPL(is_cxl_nvdimm_bridge, CXL); 59 60static int match_nvdimm_bridge(struct device *dev, void *data) 61{ 62 return is_cxl_nvdimm_bridge(dev); 63} 64 |
65struct cxl_nvdimm_bridge *cxl_find_nvdimm_bridge(struct device *start) | 65struct cxl_nvdimm_bridge *cxl_find_nvdimm_bridge(struct cxl_memdev *cxlmd) |
66{ | 66{ |
67 struct cxl_port *port = find_cxl_root(start); | 67 struct cxl_port *port = find_cxl_root(dev_get_drvdata(&cxlmd->dev)); |
68 struct device *dev; 69 70 if (!port) 71 return NULL; 72 73 dev = device_find_child(&port->dev, NULL, match_nvdimm_bridge); 74 put_device(&port->dev); 75 --- 172 unchanged lines hidden (view full) --- 248 */ 249int devm_cxl_add_nvdimm(struct cxl_memdev *cxlmd) 250{ 251 struct cxl_nvdimm_bridge *cxl_nvb; 252 struct cxl_nvdimm *cxl_nvd; 253 struct device *dev; 254 int rc; 255 | 68 struct device *dev; 69 70 if (!port) 71 return NULL; 72 73 dev = device_find_child(&port->dev, NULL, match_nvdimm_bridge); 74 put_device(&port->dev); 75 --- 172 unchanged lines hidden (view full) --- 248 */ 249int devm_cxl_add_nvdimm(struct cxl_memdev *cxlmd) 250{ 251 struct cxl_nvdimm_bridge *cxl_nvb; 252 struct cxl_nvdimm *cxl_nvd; 253 struct device *dev; 254 int rc; 255 |
256 cxl_nvb = cxl_find_nvdimm_bridge(&cxlmd->dev); | 256 cxl_nvb = cxl_find_nvdimm_bridge(cxlmd); |
257 if (!cxl_nvb) 258 return -ENODEV; 259 260 cxl_nvd = cxl_nvdimm_alloc(cxl_nvb, cxlmd); 261 if (IS_ERR(cxl_nvd)) { 262 rc = PTR_ERR(cxl_nvd); 263 goto err_alloc; 264 } --- 26 unchanged lines hidden --- | 257 if (!cxl_nvb) 258 return -ENODEV; 259 260 cxl_nvd = cxl_nvdimm_alloc(cxl_nvb, cxlmd); 261 if (IS_ERR(cxl_nvd)) { 262 rc = PTR_ERR(cxl_nvd); 263 goto err_alloc; 264 } --- 26 unchanged lines hidden --- |