1
0
Fork 0

staging: unisys: remove driver version from struct visor_driver

This patch removes the all instances of the driver version from
struct visor_driver. This includes removing version, vertag
(a human readable version string of the driver version) and
version_attr from struct visor_driver. This resulted in removing the
bus attributes and driver attributes which only contained the driver
version. The utsname function is used to replace the driver version
with the kernel version in bus_device_info_init().

Signed-off-by: Jon Frisch <jon.frisch@unisys.com>
Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
hifive-unleashed-5.1
Jon Frisch 2016-09-26 11:03:41 -04:00 committed by Greg Kroah-Hartman
parent 2460563fb4
commit e82ed633eb
6 changed files with 8 additions and 92 deletions

View File

@ -66,8 +66,6 @@ struct visor_channeltype_descriptor {
* struct visor_driver - Information provided by each visor driver when it
* registers with the visorbus driver.
* @name: Name of the visor driver.
* @version: The numbered version of the driver (x.x.xxx).
* @vertag: A human readable version string.
* @owner: The module owner.
* @channel_types: Types of channels handled by this driver, ending with
* a zero GUID. Our specialized BUS.match() method knows
@ -94,12 +92,9 @@ struct visor_channeltype_descriptor {
* @resume: Behaves similar to pause.
* @driver: Private reference to the device driver. For use by bus
* driver only.
* @version_attr: Private version field. For use by bus driver only.
*/
struct visor_driver {
const char *name;
const char *version;
const char *vertag;
struct module *owner;
struct visor_channeltype_descriptor *channel_types;
int (*probe)(struct visor_device *dev);
@ -112,7 +107,6 @@ struct visor_driver {
/* These fields are for private use by the bus driver only. */
struct device_driver driver;
struct driver_attribute version_attr;
};
#define to_visor_driver(x) ((x) ? \

View File

@ -67,8 +67,7 @@ static const uuid_le spar_vbus_channel_protocol_uuid =
struct ultra_vbus_deviceinfo {
u8 devtype[16]; /* short string identifying the device type */
u8 drvname[16]; /* driver .sys file name */
u8 infostrs[96]; /* sequence of tab-delimited id strings: */
/* <DRIVER_REV> <DRIVER_VERTAG> <DRIVER_COMPILETIME> */
u8 infostrs[96]; /* kernel version */
u8 reserved[128]; /* pad size to 256 bytes */
};

View File

@ -18,7 +18,6 @@
#include "visorbus.h"
#include "visorbus_private.h"
#include "version.h"
#include "vmcallinterface.h"
#define MYDRVNAME "visorbus"
@ -35,34 +34,6 @@ static int visorbus_forcenomatch;
static int busreg_rc = -ENODEV; /* stores the result from bus registration */
/*
* BUS type attributes
*
* define & implement display of bus attributes under
* /sys/bus/visorbus.
*/
static ssize_t version_show(struct bus_type *bus, char *buf)
{
return snprintf(buf, PAGE_SIZE, "%s\n", VERSION);
}
static BUS_ATTR_RO(version);
static struct attribute *visorbus_bus_attrs[] = {
&bus_attr_version.attr,
NULL,
};
static const struct attribute_group visorbus_bus_group = {
.attrs = visorbus_bus_attrs,
};
static const struct attribute_group *visorbus_bus_groups[] = {
&visorbus_bus_group,
NULL,
};
/*
* DEVICE type attributes
*
@ -167,7 +138,6 @@ struct bus_type visorbus_type = {
.match = visorbus_match,
.uevent = visorbus_uevent,
.dev_groups = visorbus_dev_groups,
.bus_groups = visorbus_bus_groups,
};
/**
@ -465,36 +435,6 @@ static const struct attribute_group *visorbus_groups[] = {
NULL
};
/*
* DRIVER attributes
*
* define & implement display of driver attributes under
* /sys/bus/visorbus/drivers/<drivername>.
*/
static ssize_t
DRIVER_ATTR_version(struct device_driver *xdrv, char *buf)
{
struct visor_driver *drv = to_visor_driver(xdrv);
return snprintf(buf, PAGE_SIZE, "%s\n", drv->version);
}
static int
register_driver_attributes(struct visor_driver *drv)
{
struct driver_attribute version =
__ATTR(version, S_IRUGO, DRIVER_ATTR_version, NULL);
drv->version_attr = version;
return driver_create_file(&drv->driver, &drv->version_attr);
}
static void
unregister_driver_attributes(struct visor_driver *drv)
{
driver_remove_file(&drv->driver, &drv->version_attr);
}
static void
dev_periodic_work(unsigned long __opaque)
{
@ -567,7 +507,6 @@ visordriver_remove_device(struct device *xdev)
void
visorbus_unregister_visor_driver(struct visor_driver *drv)
{
unregister_driver_attributes(drv);
driver_unregister(&drv->driver);
}
EXPORT_SYMBOL_GPL(visorbus_unregister_visor_driver);
@ -882,9 +821,7 @@ fix_vbus_dev_info(struct visor_device *visordev)
}
}
bus_device_info_init(&dev_info, chan_type_name,
visordrv->name, visordrv->version,
visordrv->vertag);
bus_device_info_init(&dev_info, chan_type_name, visordrv->name);
write_vbus_dev_info(bdev->visorchannel, hdr_info, &dev_info, dev_no);
/*
@ -1014,9 +951,6 @@ int visorbus_register_visor_driver(struct visor_driver *drv)
*/
rc = driver_register(&drv->driver);
if (rc < 0)
return rc;
rc = register_driver_attributes(drv);
if (rc < 0)
driver_unregister(&drv->driver);
return rc;
@ -1343,9 +1277,7 @@ visorbus_init(void)
int err;
POSTCODE_LINUX_3(DRIVER_ENTRY_PC, 0, POSTCODE_SEVERITY_INFO);
bus_device_info_init(&clientbus_driverinfo,
"clientbus", "visorbus",
VERSION, NULL);
bus_device_info_init(&clientbus_driverinfo, "clientbus", "visorbus");
err = create_bus_type();
if (err < 0) {
@ -1353,9 +1285,7 @@ visorbus_init(void)
goto error;
}
bus_device_info_init(&chipset_driverinfo,
"chipset", "visorchipset",
VERSION, NULL);
bus_device_info_init(&chipset_driverinfo, "chipset", "visorchipset");
return 0;

View File

@ -18,6 +18,7 @@
#define __VISORBUS_PRIVATE_H__
#include <linux/uuid.h>
#include <linux/utsname.h>
#include "controlvmchannel.h"
#include "vbuschannel.h"
@ -26,12 +27,9 @@
* command line
*/
#define TARGET_HOSTNAME "linuxguest"
static inline void bus_device_info_init(
struct ultra_vbus_deviceinfo *bus_device_info_ptr,
const char *dev_type, const char *drv_name,
const char *ver, const char *ver_tag)
const char *dev_type, const char *drv_name)
{
memset(bus_device_info_ptr, 0, sizeof(struct ultra_vbus_deviceinfo));
snprintf(bus_device_info_ptr->devtype,
@ -41,10 +39,8 @@ static inline void bus_device_info_init(
sizeof(bus_device_info_ptr->drvname),
"%s", (drv_name) ? drv_name : "unknownDriver");
snprintf(bus_device_info_ptr->infostrs,
sizeof(bus_device_info_ptr->infostrs), "%s\t%s\t%s",
(ver) ? ver : "unknownVer",
(ver_tag) ? ver_tag : "unknownVerTag",
TARGET_HOSTNAME);
sizeof(bus_device_info_ptr->infostrs), "kernel ver. %s",
utsname()->release);
}
void chipset_bus_create(struct visor_device *bus_info);

View File

@ -735,7 +735,6 @@ static struct visor_channeltype_descriptor visorinput_channel_types[] = {
static struct visor_driver visorinput_driver = {
.name = "visorinput",
.vertag = NULL,
.owner = THIS_MODULE,
.channel_types = visorinput_channel_types,
.probe = visorinput_probe,

View File

@ -2033,8 +2033,6 @@ static int visornic_resume(struct visor_device *dev,
*/
static struct visor_driver visornic_driver = {
.name = "visornic",
.version = "1.0.0.0",
.vertag = NULL,
.owner = THIS_MODULE,
.channel_types = visornic_channel_types,
.probe = visornic_probe,