Skip to content

Commit fec04ed

Browse files
Dr. David Alan Gilbertandersson
authored andcommitted
hwspinlock: Remove unused hwspin_lock_get_id()
hwspin_lock_get_id() has been unused since the original 2011 commit bd9a4c7 ("drivers: hwspinlock: add framework") Remove it and the corresponding docs. Note that the of_hwspin_lock_get_id() version is still in use, so leave that alone. Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org> Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com> Link: https://lore.kernel.org/r/20241215022023.181435-1-linux@treblig.org Signed-off-by: Bjorn Andersson <andersson@kernel.org>
1 parent e9a3682 commit fec04ed

File tree

3 files changed

+0
-34
lines changed

3 files changed

+0
-34
lines changed

Documentation/locking/hwspinlock.rst

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -301,17 +301,6 @@ The caller should **never** unlock an hwspinlock which is already unlocked.
301301
Doing so is considered a bug (there is no protection against this).
302302
This function will never sleep.
303303

304-
::
305-
306-
int hwspin_lock_get_id(struct hwspinlock *hwlock);
307-
308-
Retrieve id number of a given hwspinlock. This is needed when an
309-
hwspinlock is dynamically assigned: before it can be used to achieve
310-
mutual exclusion with a remote cpu, the id number should be communicated
311-
to the remote task with which we want to synchronize.
312-
313-
Returns the hwspinlock id number, or -EINVAL if hwlock is null.
314-
315304
Typical usage
316305
=============
317306

drivers/hwspinlock/hwspinlock_core.c

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -709,23 +709,6 @@ static int __hwspin_lock_request(struct hwspinlock *hwlock)
709709
return ret;
710710
}
711711

712-
/**
713-
* hwspin_lock_get_id() - retrieve id number of a given hwspinlock
714-
* @hwlock: a valid hwspinlock instance
715-
*
716-
* Returns: the id number of a given @hwlock, or -EINVAL if @hwlock is invalid.
717-
*/
718-
int hwspin_lock_get_id(struct hwspinlock *hwlock)
719-
{
720-
if (!hwlock) {
721-
pr_err("invalid hwlock\n");
722-
return -EINVAL;
723-
}
724-
725-
return hwlock_to_id(hwlock);
726-
}
727-
EXPORT_SYMBOL_GPL(hwspin_lock_get_id);
728-
729712
/**
730713
* hwspin_lock_request_specific() - request for a specific hwspinlock
731714
* @id: index of the specific hwspinlock that is requested

include/linux/hwspinlock.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ int hwspin_lock_unregister(struct hwspinlock_device *bank);
6161
struct hwspinlock *hwspin_lock_request_specific(unsigned int id);
6262
int hwspin_lock_free(struct hwspinlock *hwlock);
6363
int of_hwspin_lock_get_id(struct device_node *np, int index);
64-
int hwspin_lock_get_id(struct hwspinlock *hwlock);
6564
int __hwspin_lock_timeout(struct hwspinlock *, unsigned int, int,
6665
unsigned long *);
6766
int __hwspin_trylock(struct hwspinlock *, int, unsigned long *);
@@ -131,11 +130,6 @@ static inline int of_hwspin_lock_get_id(struct device_node *np, int index)
131130
return 0;
132131
}
133132

134-
static inline int hwspin_lock_get_id(struct hwspinlock *hwlock)
135-
{
136-
return 0;
137-
}
138-
139133
static inline
140134
int of_hwspin_lock_get_id_byname(struct device_node *np, const char *name)
141135
{

0 commit comments

Comments
 (0)