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

Commit d5b3f1dc authored by Erik Arfvidson's avatar Erik Arfvidson Committed by Greg Kroah-Hartman
Browse files

staging: unisys: move timskmod.h functionality



This patch removes all timksmod.h pound defines. It also removes
visorkmodutils.c since it no longer has any use by itself. Since
visorkmodutils.c is no longer needed the module_init for
visorchipset.c is modified to call visorutil_spar_detect directly
instead of the extern variable in timksmod.h.

Signed-off-by: default avatarErik Arfvidson <erik.arfvidson@unisys.com>
Signed-off-by: default avatarBenjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 01f125ca
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@

#include "timskmod.h"


/* PERIODIC_WORK an opaque structure to users.
 * Fields are declared only in the implementation .c files.
 */
+0 −94
Original line number Diff line number Diff line
@@ -51,98 +51,4 @@
#include <linux/seq_file.h>
#include <linux/mm.h>

/* #define DEBUG */
#if !defined SUCCESS
#define SUCCESS 0
#endif
#define MIN(a, b)     (((a) < (b)) ? (a) : (b))
#define MAX(a, b)     (((a) > (b)) ? (a) : (b))
#define STRUCTSEQUAL(x, y) (memcmp(&x, &y, sizeof(x)) == 0)
#ifndef HOSTADDRESS
#define HOSTADDRESS unsigned long long
#endif

#define sizeofmember(TYPE, MEMBER) (sizeof(((TYPE *)0)->MEMBER))
/** "Covered quotient" function */
#define COVQ(v, d)  (((v) + (d) - 1) / (d))
#define SWAPPOINTERS(p1, p2)				\
	do {						\
		void *SWAPPOINTERS_TEMP = (void *)p1;	\
		(void *)(p1) = (void *)(p2);            \
		(void *)(p2) = SWAPPOINTERS_TEMP;	\
	} while (0)

#define WARNDRV(fmt, args...)   LOGWRN(fmt, ## args)
#define SECUREDRV(fmt, args...) LOGWRN(fmt, ## args)

#define PRINTKDEV(devname, fmt, args...)  LOGINFDEV(devname, fmt, ## args)
#define TBDDEV(devname, fmt, args...)     LOGERRDEV(devname, fmt, ## args)
#define HUHDEV(devname, fmt, args...)     LOGERRDEV(devname, fmt, ## args)
#define ERRDEV(devname, fmt, args...)     LOGERRDEV(devname, fmt, ## args)
#define ERRDEVX(devno, fmt, args...)	  LOGERRDEVX(devno, fmt, ## args)
#define WARNDEV(devname, fmt, args...)    LOGWRNDEV(devname, fmt, ## args)
#define SECUREDEV(devname, fmt, args...)  LOGWRNDEV(devname, fmt, ## args)
#define INFODEV(devname, fmt, args...)    LOGINFDEV(devname, fmt, ## args)
#define INFODEVX(devno, fmt, args...)     LOGINFDEVX(devno, fmt, ## args)

/** Verifies the consistency of your PRIVATEDEVICEDATA structure using
 *  conventional "signature" fields:
 *  <p>
 *  - sig1 should contain the size of the structure
 *  - sig2 should contain a pointer to the beginning of the structure
 */
#define DDLOOKSVALID(dd)                                 \
		((dd != NULL)                             &&	\
		 ((dd)->sig1 == sizeof(PRIVATEDEVICEDATA)) &&	\
		 ((dd)->sig2 == dd))

/** Verifies the consistency of your PRIVATEFILEDATA structure using
 *  conventional "signature" fields:
 *  <p>
 *  - sig1 should contain the size of the structure
 *  - sig2 should contain a pointer to the beginning of the structure
 */
#define FDLOOKSVALID(fd)                               \
	((fd != NULL)                           &&     \
	 ((fd)->sig1 == sizeof(PRIVATEFILEDATA)) &&    \
	 ((fd)->sig2 == fd))

/** Sleep for an indicated number of seconds (for use in kernel mode).
 *  x - the number of seconds to sleep.
 */
#define SLEEP(x)					     \
	do { __set_current_state(TASK_INTERRUPTIBLE);        \
		schedule_timeout((x)*HZ);		     \
	} while (0)

/** Sleep for an indicated number of jiffies (for use in kernel mode).
 *  x - the number of jiffies to sleep.
 */
#define SLEEPJIFFIES(x)						    \
	do { __set_current_state(TASK_INTERRUPTIBLE);		    \
		schedule_timeout(x);				    \
	} while (0)

static inline struct cdev *cdev_alloc_init(struct module *owner,
					   const struct file_operations *fops)
{
	struct cdev *cdev = NULL;

	cdev = cdev_alloc();
	if (!cdev)
		return NULL;
	cdev->ops = fops;
	cdev->owner = owner;

	/* Note that the memory allocated for cdev will be deallocated
	 * when the usage count drops to 0, because it is controlled
	 * by a kobject of type ktype_cdev_dynamic.  (This
	 * deallocation could very well happen outside of our kernel
	 * module, like via the cdev_put in __fput() for example.)
	 */
	return cdev;
}

extern int unisys_spar_platform;

#endif
+3 −7
Original line number Diff line number Diff line
@@ -37,10 +37,6 @@
#include "periodic_work.h"
#include "channel.h"

#ifndef HOSTADDRESS
#define HOSTADDRESS u64
#endif

struct visor_driver;
struct visor_device;

@@ -170,9 +166,9 @@ void visorbus_disable_channel_interrupts(struct visor_device *dev);
 * <channel_bytes> and <guid> arguments may be 0 if we are a channel CLIENT.
 * In this case, the values can simply be read from the channel header.
 */
struct visorchannel *visorchannel_create(HOSTADDRESS physaddr,
struct visorchannel *visorchannel_create(u64 physaddr,
					 ulong channel_bytes, uuid_le guid);
struct visorchannel *visorchannel_create_with_lock(HOSTADDRESS physaddr,
struct visorchannel *visorchannel_create_with_lock(u64 physaddr,
						   ulong channel_bytes,
						   uuid_le guid);
void visorchannel_destroy(struct visorchannel *channel);
@@ -189,7 +185,7 @@ bool visorchannel_signalinsert(struct visorchannel *channel, u32 queue,
int visorchannel_signalqueue_slots_avail(struct visorchannel *channel,
					 u32 queue);
int visorchannel_signalqueue_max_slots(struct visorchannel *channel, u32 queue);
HOSTADDRESS visorchannel_get_physaddr(struct visorchannel *channel);
u64 visorchannel_get_physaddr(struct visorchannel *channel);
ulong visorchannel_get_nbytes(struct visorchannel *channel);
char *visorchannel_id(struct visorchannel *channel, char *s);
char *visorchannel_zoneid(struct visorchannel *channel, char *s);
+5 −4
Original line number Diff line number Diff line
@@ -1428,7 +1428,7 @@ remove_visor_device(struct visor_device *dev)
}

static struct visor_device *
find_visor_device_by_channel(HOSTADDRESS channel_physaddr)
find_visor_device_by_channel(u64 channel_physaddr)
{
	struct list_head *listentry, *listtmp;

@@ -1607,8 +1607,9 @@ fix_vbus_dev_info(struct visor_device *visordev)
	 * type name
	 */
	for (i = 0; visordrv->channel_types[i].name; i++) {
		if (STRUCTSEQUAL(visordrv->channel_types[i].guid,
				 visordev->channel_type_guid)) {
		if (memcmp(&visordrv->channel_types[i].guid,
			   &visordev->channel_type_guid,
			   sizeof(visordrv->channel_types[i].guid)) == 0) {
			chan_type_name = visordrv->channel_types[i].name;
			break;
		}
@@ -1667,7 +1668,7 @@ create_bus_instance(int id)
	if ((visorchipset_get_bus_info(id, &bus_info)) &&
	    (bus_info.chan_info.channel_addr > 0) &&
	    (bus_info.chan_info.n_channel_bytes > 0)) {
		HOSTADDRESS channel_addr = bus_info.chan_info.channel_addr;
		u64 channel_addr = bus_info.chan_info.channel_addr;
		unsigned long n_channel_bytes =
				(unsigned long)
				bus_info.chan_info.n_channel_bytes;
+1 −1
Original line number Diff line number Diff line
@@ -54,7 +54,7 @@ enum visorchipset_addresstype {
 */
struct visorchipset_channel_info {
	enum visorchipset_addresstype addr_type;
	HOSTADDRESS channel_addr;
	u64 channel_addr;
	struct irq_info intr;
	u64 n_channel_bytes;
	uuid_le channel_type_uuid;
Loading