pmem.c (bd429e5355cd58aeb7e38b905fbecee357a6379b) | pmem.c (452996fa079b1a8751a02ac04c54b1d69f512249) |
---|---|
1// SPDX-License-Identifier: GPL-2.0-only 2/* Copyright(c) 2021 Intel Corporation. All rights reserved. */ 3#include <linux/libnvdimm.h> 4#include <asm/unaligned.h> 5#include <linux/device.h> 6#include <linux/module.h> 7#include <linux/ndctl.h> 8#include <linux/async.h> --- 37 unchanged lines hidden (view full) --- 46 device_lock(&cxl_nvb->dev); 47 } 48 device_unlock(&cxl_nvb->dev); 49 50 nvdimm_delete(nvdimm); 51 cxl_nvd->bridge = NULL; 52} 53 | 1// SPDX-License-Identifier: GPL-2.0-only 2/* Copyright(c) 2021 Intel Corporation. All rights reserved. */ 3#include <linux/libnvdimm.h> 4#include <asm/unaligned.h> 5#include <linux/device.h> 6#include <linux/module.h> 7#include <linux/ndctl.h> 8#include <linux/async.h> --- 37 unchanged lines hidden (view full) --- 46 device_lock(&cxl_nvb->dev); 47 } 48 device_unlock(&cxl_nvb->dev); 49 50 nvdimm_delete(nvdimm); 51 cxl_nvd->bridge = NULL; 52} 53 |
54static ssize_t provider_show(struct device *dev, struct device_attribute *attr, char *buf) 55{ 56 struct nvdimm *nvdimm = to_nvdimm(dev); 57 struct cxl_nvdimm *cxl_nvd = nvdimm_provider_data(nvdimm); 58 59 return sysfs_emit(buf, "%s\n", dev_name(&cxl_nvd->dev)); 60} 61static DEVICE_ATTR_RO(provider); 62 |
|
54static ssize_t id_show(struct device *dev, struct device_attribute *attr, char *buf) 55{ 56 struct nvdimm *nvdimm = to_nvdimm(dev); 57 struct cxl_nvdimm *cxl_nvd = nvdimm_provider_data(nvdimm); 58 struct cxl_dev_state *cxlds = cxl_nvd->cxlmd->cxlds; 59 60 return sysfs_emit(buf, "%lld\n", cxlds->serial); 61} 62static DEVICE_ATTR_RO(id); 63 64static struct attribute *cxl_dimm_attributes[] = { 65 &dev_attr_id.attr, | 63static ssize_t id_show(struct device *dev, struct device_attribute *attr, char *buf) 64{ 65 struct nvdimm *nvdimm = to_nvdimm(dev); 66 struct cxl_nvdimm *cxl_nvd = nvdimm_provider_data(nvdimm); 67 struct cxl_dev_state *cxlds = cxl_nvd->cxlmd->cxlds; 68 69 return sysfs_emit(buf, "%lld\n", cxlds->serial); 70} 71static DEVICE_ATTR_RO(id); 72 73static struct attribute *cxl_dimm_attributes[] = { 74 &dev_attr_id.attr, |
75 &dev_attr_provider.attr, |
|
66 NULL 67}; 68 69static const struct attribute_group cxl_dimm_attribute_group = { 70 .name = "cxl", 71 .attrs = cxl_dimm_attributes, 72}; 73 --- 616 unchanged lines hidden --- | 76 NULL 77}; 78 79static const struct attribute_group cxl_dimm_attribute_group = { 80 .name = "cxl", 81 .attrs = cxl_dimm_attributes, 82}; 83 --- 616 unchanged lines hidden --- |