staging: unisys: remove visorbus_type extern

The variable visorbus_type could be contained to the visorbus_main.c
file by moving the two functions that referenced it visorchipset.c. This
allowed us to remove the incorrect extern from the include file visorbus.h.

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:
David Kershner 2017-09-27 13:14:36 -04:00 committed by Greg Kroah-Hartman
parent 6c073dabce
commit 69a4d1e758
4 changed files with 38 additions and 38 deletions

View File

@ -31,8 +31,6 @@
#include "channel.h"
extern struct bus_type visorbus_type;
struct visorchipset_state {
u32 created:1;
u32 attached:1;

View File

@ -159,13 +159,48 @@ static int visorbus_match(struct device *xdev, struct device_driver *xdrv)
* This describes the TYPE of bus.
* (Don't confuse this with an INSTANCE of the bus.)
*/
struct bus_type visorbus_type = {
static struct bus_type visorbus_type = {
.name = "visorbus",
.match = visorbus_match,
.uevent = visorbus_uevent,
.dev_groups = visorbus_dev_groups,
};
struct visor_busdev {
u32 bus_no;
u32 dev_no;
};
static int match_visorbus_dev_by_id(struct device *dev, void *data)
{
struct visor_device *vdev = to_visor_device(dev);
struct visor_busdev *id = data;
if ((vdev->chipset_bus_no == id->bus_no) &&
(vdev->chipset_dev_no == id->dev_no))
return 1;
return 0;
}
struct visor_device *visorbus_get_device_by_id(u32 bus_no, u32 dev_no,
struct visor_device *from)
{
struct device *dev;
struct device *dev_start = NULL;
struct visor_busdev id = {
.bus_no = bus_no,
.dev_no = dev_no
};
if (from)
dev_start = &from->device;
dev = bus_find_device(&visorbus_type, dev_start, (void *)&id,
match_visorbus_dev_by_id);
if (!dev)
return NULL;
return to_visor_device(dev);
}
/*
* visorbus_release_busdevice() - called when device_unregister() is called for
* the bus device instance, after all other tasks

View File

@ -23,6 +23,8 @@
#include "vbuschannel.h"
#include "visorbus.h"
struct visor_device *visorbus_get_device_by_id(u32 bus_no, u32 dev_no,
struct visor_device *from);
int visorbus_create_instance(struct visor_device *dev);
void visorbus_remove_instance(struct visor_device *bus_info);
int create_visor_device(struct visor_device *dev_info);

View File

@ -288,41 +288,6 @@ static ssize_t remaining_steps_store(struct device *dev,
}
static DEVICE_ATTR_RW(remaining_steps);
struct visor_busdev {
u32 bus_no;
u32 dev_no;
};
static int match_visorbus_dev_by_id(struct device *dev, void *data)
{
struct visor_device *vdev = to_visor_device(dev);
struct visor_busdev *id = data;
if ((vdev->chipset_bus_no == id->bus_no) &&
(vdev->chipset_dev_no == id->dev_no))
return 1;
return 0;
}
struct visor_device *visorbus_get_device_by_id(u32 bus_no, u32 dev_no,
struct visor_device *from)
{
struct device *dev;
struct device *dev_start = NULL;
struct visor_busdev id = {
.bus_no = bus_no,
.dev_no = dev_no
};
if (from)
dev_start = &from->device;
dev = bus_find_device(&visorbus_type, dev_start, (void *)&id,
match_visorbus_dev_by_id);
if (!dev)
return NULL;
return to_visor_device(dev);
}
static void controlvm_init_response(struct controlvm_message *msg,
struct controlvm_message_header *msg_hdr,
int response)