pvpanic-mmio.c (cc5b392d0f94f27743583140d819fa35a46899db) | pvpanic-mmio.c (84b0f12a953c4feff9994b1c4583ed18b441f482) |
---|---|
1// SPDX-License-Identifier: GPL-2.0+ 2/* 3 * Pvpanic MMIO Device Support 4 * 5 * Copyright (C) 2013 Fujitsu. 6 * Copyright (C) 2018 ZTE. 7 * Copyright (C) 2021 Oracle. 8 */ --- 10 unchanged lines hidden (view full) --- 19#include <uapi/misc/pvpanic.h> 20 21#include "pvpanic.h" 22 23MODULE_AUTHOR("Hu Tao <hutao@cn.fujitsu.com>"); 24MODULE_DESCRIPTION("pvpanic-mmio device driver"); 25MODULE_LICENSE("GPL"); 26 | 1// SPDX-License-Identifier: GPL-2.0+ 2/* 3 * Pvpanic MMIO Device Support 4 * 5 * Copyright (C) 2013 Fujitsu. 6 * Copyright (C) 2018 ZTE. 7 * Copyright (C) 2021 Oracle. 8 */ --- 10 unchanged lines hidden (view full) --- 19#include <uapi/misc/pvpanic.h> 20 21#include "pvpanic.h" 22 23MODULE_AUTHOR("Hu Tao <hutao@cn.fujitsu.com>"); 24MODULE_DESCRIPTION("pvpanic-mmio device driver"); 25MODULE_LICENSE("GPL"); 26 |
27static ssize_t capability_show(struct device *dev, 28 struct device_attribute *attr, char *buf) | 27static ssize_t capability_show(struct device *dev, struct device_attribute *attr, char *buf) |
29{ 30 struct pvpanic_instance *pi = dev_get_drvdata(dev); 31 32 return sysfs_emit(buf, "%x\n", pi->capability); 33} 34static DEVICE_ATTR_RO(capability); 35 | 28{ 29 struct pvpanic_instance *pi = dev_get_drvdata(dev); 30 31 return sysfs_emit(buf, "%x\n", pi->capability); 32} 33static DEVICE_ATTR_RO(capability); 34 |
36static ssize_t events_show(struct device *dev, struct device_attribute *attr, char *buf) | 35static ssize_t events_show(struct device *dev, struct device_attribute *attr, char *buf) |
37{ 38 struct pvpanic_instance *pi = dev_get_drvdata(dev); 39 40 return sysfs_emit(buf, "%x\n", pi->events); 41} 42 | 36{ 37 struct pvpanic_instance *pi = dev_get_drvdata(dev); 38 39 return sysfs_emit(buf, "%x\n", pi->events); 40} 41 |
43static ssize_t events_store(struct device *dev, struct device_attribute *attr, | 42static ssize_t events_store(struct device *dev, struct device_attribute *attr, |
44 const char *buf, size_t count) 45{ 46 struct pvpanic_instance *pi = dev_get_drvdata(dev); 47 unsigned int tmp; 48 int err; 49 50 err = kstrtouint(buf, 16, &tmp); 51 if (err) --- 80 unchanged lines hidden --- | 43 const char *buf, size_t count) 44{ 45 struct pvpanic_instance *pi = dev_get_drvdata(dev); 46 unsigned int tmp; 47 int err; 48 49 err = kstrtouint(buf, 16, &tmp); 50 if (err) --- 80 unchanged lines hidden --- |