staging: unisys: visorbus: Remove useless checks in visorbus_main.c
Removes checks that all visor_device instances have an associated visorchannel. Due to the design of the s-Par drivers these checks are unnecessary. Signed-off-by: David Binder <david.binder@unisys.com> Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Tim Sell <timothy.sell@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Родитель
287f13f48e
Коммит
bf8d0e947f
|
@ -185,8 +185,6 @@ static ssize_t physaddr_show(struct device *dev, struct device_attribute *attr,
|
||||||
{
|
{
|
||||||
struct visor_device *vdev = to_visor_device(dev);
|
struct visor_device *vdev = to_visor_device(dev);
|
||||||
|
|
||||||
if (!vdev->visorchannel)
|
|
||||||
return 0;
|
|
||||||
return sprintf(buf, "0x%llx\n",
|
return sprintf(buf, "0x%llx\n",
|
||||||
visorchannel_get_physaddr(vdev->visorchannel));
|
visorchannel_get_physaddr(vdev->visorchannel));
|
||||||
}
|
}
|
||||||
|
@ -197,8 +195,6 @@ static ssize_t nbytes_show(struct device *dev, struct device_attribute *attr,
|
||||||
{
|
{
|
||||||
struct visor_device *vdev = to_visor_device(dev);
|
struct visor_device *vdev = to_visor_device(dev);
|
||||||
|
|
||||||
if (!vdev->visorchannel)
|
|
||||||
return 0;
|
|
||||||
return sprintf(buf, "0x%lx\n",
|
return sprintf(buf, "0x%lx\n",
|
||||||
visorchannel_get_nbytes(vdev->visorchannel));
|
visorchannel_get_nbytes(vdev->visorchannel));
|
||||||
}
|
}
|
||||||
|
@ -209,8 +205,6 @@ static ssize_t clientpartition_show(struct device *dev,
|
||||||
{
|
{
|
||||||
struct visor_device *vdev = to_visor_device(dev);
|
struct visor_device *vdev = to_visor_device(dev);
|
||||||
|
|
||||||
if (!vdev->visorchannel)
|
|
||||||
return 0;
|
|
||||||
return sprintf(buf, "0x%llx\n",
|
return sprintf(buf, "0x%llx\n",
|
||||||
visorchannel_get_clientpartition(vdev->visorchannel));
|
visorchannel_get_clientpartition(vdev->visorchannel));
|
||||||
}
|
}
|
||||||
|
@ -222,8 +216,6 @@ static ssize_t typeguid_show(struct device *dev, struct device_attribute *attr,
|
||||||
struct visor_device *vdev = to_visor_device(dev);
|
struct visor_device *vdev = to_visor_device(dev);
|
||||||
char typeid[LINESIZE];
|
char typeid[LINESIZE];
|
||||||
|
|
||||||
if (!vdev->visorchannel)
|
|
||||||
return 0;
|
|
||||||
return sprintf(buf, "%s\n",
|
return sprintf(buf, "%s\n",
|
||||||
visorchannel_id(vdev->visorchannel, typeid));
|
visorchannel_id(vdev->visorchannel, typeid));
|
||||||
}
|
}
|
||||||
|
@ -235,8 +227,6 @@ static ssize_t zoneguid_show(struct device *dev, struct device_attribute *attr,
|
||||||
struct visor_device *vdev = to_visor_device(dev);
|
struct visor_device *vdev = to_visor_device(dev);
|
||||||
char zoneid[LINESIZE];
|
char zoneid[LINESIZE];
|
||||||
|
|
||||||
if (!vdev->visorchannel)
|
|
||||||
return 0;
|
|
||||||
return sprintf(buf, "%s\n",
|
return sprintf(buf, "%s\n",
|
||||||
visorchannel_zoneid(vdev->visorchannel, zoneid));
|
visorchannel_zoneid(vdev->visorchannel, zoneid));
|
||||||
}
|
}
|
||||||
|
@ -245,13 +235,12 @@ static DEVICE_ATTR_RO(zoneguid);
|
||||||
static ssize_t typename_show(struct device *dev, struct device_attribute *attr,
|
static ssize_t typename_show(struct device *dev, struct device_attribute *attr,
|
||||||
char *buf)
|
char *buf)
|
||||||
{
|
{
|
||||||
struct visor_device *vdev = to_visor_device(dev);
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
struct bus_type *xbus = dev->bus;
|
struct bus_type *xbus = dev->bus;
|
||||||
struct device_driver *xdrv = dev->driver;
|
struct device_driver *xdrv = dev->driver;
|
||||||
struct visor_driver *drv = NULL;
|
struct visor_driver *drv = NULL;
|
||||||
|
|
||||||
if (!vdev->visorchannel || !xbus || !xdrv)
|
if (!xbus || !xdrv)
|
||||||
return 0;
|
return 0;
|
||||||
i = xbus->match(dev, xdrv);
|
i = xbus->match(dev, xdrv);
|
||||||
if (!i)
|
if (!i)
|
||||||
|
@ -344,11 +333,10 @@ static ssize_t channel_id_show(struct device *dev,
|
||||||
struct visor_device *vdev = to_visor_device(dev);
|
struct visor_device *vdev = to_visor_device(dev);
|
||||||
int len = 0;
|
int len = 0;
|
||||||
|
|
||||||
if (vdev->visorchannel) {
|
visorchannel_id(vdev->visorchannel, buf);
|
||||||
visorchannel_id(vdev->visorchannel, buf);
|
len = strlen(buf);
|
||||||
len = strlen(buf);
|
buf[len++] = '\n';
|
||||||
buf[len++] = '\n';
|
|
||||||
}
|
|
||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
static DEVICE_ATTR_RO(channel_id);
|
static DEVICE_ATTR_RO(channel_id);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче