diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2016-09-01 12:33:46 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2016-09-01 12:33:46 -0400 |
commit | 0cb7bf61b1e9f05027de58c80f9b46a714d24e35 (patch) | |
tree | 41fb55cf62d07b425122f9a8b96412c0d8eb99c5 /drivers/nvdimm/btt_devs.c | |
parent | aa877175e7a9982233ed8f10cb4bfddd78d82741 (diff) | |
parent | 3eab887a55424fc2c27553b7bfe32330df83f7b8 (diff) |
Merge branch 'linus' into smp/hotplug
Apply upstream changes to avoid conflicts with pending patches.
Diffstat (limited to 'drivers/nvdimm/btt_devs.c')
-rw-r--r-- | drivers/nvdimm/btt_devs.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/nvdimm/btt_devs.c b/drivers/nvdimm/btt_devs.c index 3fa7919f94a8..97dd2925ed6e 100644 --- a/drivers/nvdimm/btt_devs.c +++ b/drivers/nvdimm/btt_devs.c | |||
@@ -140,10 +140,30 @@ static ssize_t namespace_store(struct device *dev, | |||
140 | } | 140 | } |
141 | static DEVICE_ATTR_RW(namespace); | 141 | static DEVICE_ATTR_RW(namespace); |
142 | 142 | ||
143 | static ssize_t size_show(struct device *dev, | ||
144 | struct device_attribute *attr, char *buf) | ||
145 | { | ||
146 | struct nd_btt *nd_btt = to_nd_btt(dev); | ||
147 | ssize_t rc; | ||
148 | |||
149 | device_lock(dev); | ||
150 | if (dev->driver) | ||
151 | rc = sprintf(buf, "%llu\n", nd_btt->size); | ||
152 | else { | ||
153 | /* no size to convey if the btt instance is disabled */ | ||
154 | rc = -ENXIO; | ||
155 | } | ||
156 | device_unlock(dev); | ||
157 | |||
158 | return rc; | ||
159 | } | ||
160 | static DEVICE_ATTR_RO(size); | ||
161 | |||
143 | static struct attribute *nd_btt_attributes[] = { | 162 | static struct attribute *nd_btt_attributes[] = { |
144 | &dev_attr_sector_size.attr, | 163 | &dev_attr_sector_size.attr, |
145 | &dev_attr_namespace.attr, | 164 | &dev_attr_namespace.attr, |
146 | &dev_attr_uuid.attr, | 165 | &dev_attr_uuid.attr, |
166 | &dev_attr_size.attr, | ||
147 | NULL, | 167 | NULL, |
148 | }; | 168 | }; |
149 | 169 | ||