Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 69a4d1e7 authored by David Kershner's avatar David Kershner Committed by Greg Kroah-Hartman
Browse files

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: default avatarDavid Kershner <david.kershner@unisys.com>
Reviewed-by: default avatarTim Sell <timothy.sell@unisys.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6c073dab
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -31,8 +31,6 @@

#include "channel.h"

extern struct bus_type visorbus_type;

struct visorchipset_state {
	u32 created:1;
	u32 attached:1;
+36 −1
Original line number Diff line number Diff line
@@ -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
+2 −0
Original line number Diff line number Diff line
@@ -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);
+0 −35
Original line number Diff line number Diff line
@@ -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)