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

Commit fa27da83 authored by Arun Kumar Neelakantam's avatar Arun Kumar Neelakantam
Browse files

hwspinlock/msm: Remove dead code



Remove the remote mutex framework as it is unused on
supported targets.

Change-Id: Ia1e2b0c82c9af514cf9366c447214ec08a845dc0
Signed-off-by: default avatarArun Kumar Neelakantam <aneela@codeaurora.org>
parent bfd7e850
Loading
Loading
Loading
Loading
+0 −34
Original line number Original line Diff line number Diff line
@@ -419,37 +419,3 @@ int _remote_spin_owner(_remote_spinlock_t *lock)
}
}
EXPORT_SYMBOL(_remote_spin_owner);
EXPORT_SYMBOL(_remote_spin_owner);
/* end common spinlock API -------------------------------------------------- */
/* end common spinlock API -------------------------------------------------- */

/* remote mutex implementation ---------------------------------------------- */
int _remote_mutex_init(struct remote_mutex_id *id, _remote_mutex_t *lock)
{
	BUG_ON(id == NULL);

	lock->delay_us = id->delay_us;
	return _remote_spin_lock_init(id->r_spinlock_id, &(lock->r_spinlock));
}
EXPORT_SYMBOL(_remote_mutex_init);

void _remote_mutex_lock(_remote_mutex_t *lock)
{
	while (!_remote_spin_trylock(&(lock->r_spinlock))) {
		if (lock->delay_us >= 1000)
			msleep(lock->delay_us/1000);
		else
			udelay(lock->delay_us);
	}
}
EXPORT_SYMBOL(_remote_mutex_lock);

void _remote_mutex_unlock(_remote_mutex_t *lock)
{
	_remote_spin_unlock(&(lock->r_spinlock));
}
EXPORT_SYMBOL(_remote_mutex_unlock);

int _remote_mutex_trylock(_remote_mutex_t *lock)
{
	return _remote_spin_trylock(&(lock->r_spinlock));
}
EXPORT_SYMBOL(_remote_mutex_trylock);
/* end remote mutex implementation ------------------------------------------ */
+0 −33
Original line number Original line Diff line number Diff line
@@ -62,37 +62,4 @@ static inline int _remote_spin_owner(_remote_spinlock_t *lock)
	return -ENODEV;
	return -ENODEV;
}
}
#endif
#endif


/* Remote mutex definitions. */

typedef struct {
	_remote_spinlock_t	r_spinlock;
	uint32_t		delay_us;
} _remote_mutex_t;

struct remote_mutex_id {
	remote_spinlock_id_t	r_spinlock_id;
	uint32_t		delay_us;
};

#ifdef CONFIG_REMOTE_SPINLOCK_MSM
int _remote_mutex_init(struct remote_mutex_id *id, _remote_mutex_t *lock);
void _remote_mutex_lock(_remote_mutex_t *lock);
void _remote_mutex_unlock(_remote_mutex_t *lock);
int _remote_mutex_trylock(_remote_mutex_t *lock);
#else
static inline
int _remote_mutex_init(struct remote_mutex_id *id, _remote_mutex_t *lock)
{
	return -EINVAL;
}
static inline void _remote_mutex_lock(_remote_mutex_t *lock) {}
static inline void _remote_mutex_unlock(_remote_mutex_t *lock) {}
static inline int _remote_mutex_trylock(_remote_mutex_t *lock)
{
	return 0;
}
#endif

#endif /* __ASM__ARCH_QC_REMOTE_SPINLOCK_H */
#endif /* __ASM__ARCH_QC_REMOTE_SPINLOCK_H */
+0 −31
Original line number Original line Diff line number Diff line
@@ -15,7 +15,6 @@
#define __LINUX_REMOTE_SPINLOCK_H
#define __LINUX_REMOTE_SPINLOCK_H


#include <linux/spinlock.h>
#include <linux/spinlock.h>
#include <linux/mutex.h>
#include <linux/msm_remote_spinlock.h>
#include <linux/msm_remote_spinlock.h>


/* Grabbing a local spin lock before going for a remote lock has several
/* Grabbing a local spin lock before going for a remote lock has several
@@ -91,34 +90,4 @@ typedef struct {


#define remote_spin_owner(lock) \
#define remote_spin_owner(lock) \
	_remote_spin_owner(&((lock)->remote))
	_remote_spin_owner(&((lock)->remote))

typedef struct {
	struct mutex local;
	_remote_mutex_t remote;
} remote_mutex_t;

#define remote_mutex_init(lock, id) \
	({ \
		mutex_init(&((lock)->local)); \
		_remote_mutex_init(id, &((lock)->remote)); \
	})
#define remote_mutex_lock(lock) \
	do { \
		mutex_lock(&((lock)->local)); \
		_remote_mutex_lock(&((lock)->remote)); \
	} while (0)
#define remote_mutex_trylock(lock) \
	({ \
		mutex_trylock(&((lock)->local)) \
		? _remote_mutex_trylock(&((lock)->remote)) \
			? 1 \
			: ({mutex_unlock(&((lock)->local)); 0; }) \
		: 0; \
	})
#define remote_mutex_unlock(lock) \
	do { \
		_remote_mutex_unlock(&((lock)->remote)); \
		mutex_unlock(&((lock)->local)); \
	} while (0)

#endif
#endif