]> git.karo-electronics.de Git - linux-beck.git/commitdiff
staging: unisys: remove driver version from struct visor_driver
authorJon Frisch <jon.frisch@unisys.com>
Mon, 26 Sep 2016 15:03:41 +0000 (11:03 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 27 Sep 2016 11:06:16 +0000 (13:06 +0200)
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>
drivers/staging/unisys/include/visorbus.h
drivers/staging/unisys/visorbus/vbuschannel.h
drivers/staging/unisys/visorbus/visorbus_main.c
drivers/staging/unisys/visorbus/visorbus_private.h
drivers/staging/unisys/visorinput/visorinput.c
drivers/staging/unisys/visornic/visornic_main.c

index 993cf1947723b93a10a6fa85ca5f3e11d1be9ab7..2e508c2fc96c2244d9dde846f535cfb0f70e1df4 100644 (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) ? \
index 3f7830bbd22e2dbfd149d88d57a159d9bd4613fe..e97917522f6aae7dfa84ad30158d256403a74fd5 100644 (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 */
 };
 
index 3918bb586b93aa00a083e255eee044ed00002f45..1f3d2e0bf966319510015c191632d8b4ee45fe2f 100644 (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;
 
index 2f4e1e6071f50c9d491bd900b6c3205fab97a12f..15403fb5284727402f0e98fbcd112a5687b05efe 100644 (file)
@@ -18,6 +18,7 @@
 #define __VISORBUS_PRIVATE_H__
 
 #include <linux/uuid.h>
+#include <linux/utsname.h>
 
 #include "controlvmchannel.h"
 #include "vbuschannel.h"
  * 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);
index 641cdab34449b623ff59427c513be78f268da6b1..4e0b26d2b6f78ab6c5283c39e0b4e114dcf0a582 100644 (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,
index 6b206be18f5fcb95014da33f32d8f7ca5be7b0d6..7a58d2eac2708d7915e054bd0f24c44adb58a378 100644 (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,