aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/linkmode.h
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2018-12-05 16:26:16 -0800
committerDavid S. Miller <davem@davemloft.net>2018-12-05 16:26:16 -0800
commit7127f2fece7b431f0d9a6262f92073b564f8cf03 (patch)
treef0d724457dd46954952c7db156d267beed5e1545 /include/linux/linkmode.h
parentnet: documentation: build a directory structure for drivers (diff)
parentnet: phy: Fix ioctl handler when modifing MII_ADVERTISE (diff)
downloadlinux-dev-7127f2fece7b431f0d9a6262f92073b564f8cf03.tar.xz
linux-dev-7127f2fece7b431f0d9a6262f92073b564f8cf03.zip
Merge branch 'u32-to-linkmode-fixes'
Andrew Lunn says: ==================== u32 to linkmode fixes This patchset fixes issues found in the last patchset which converted the phydev advertise etc, from a u32 to a linux bitmap. Most of the issues are the result of clearing bits which should not of been cleared. To make the API clearer, the idea from Heiner Kallweit was used, with _mod_ to indicate the function modifies just the bits it needs to, or _to_ to clear all bits and just set bit that need to be set. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/linkmode.h')
-rw-r--r--include/linux/linkmode.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/linkmode.h b/include/linux/linkmode.h
index 22443d7fb5cd..a99c58866860 100644
--- a/include/linux/linkmode.h
+++ b/include/linux/linkmode.h
@@ -57,6 +57,15 @@ static inline void linkmode_clear_bit(int nr, volatile unsigned long *addr)
__clear_bit(nr, addr);
}
+static inline void linkmode_mod_bit(int nr, volatile unsigned long *addr,
+ int set)
+{
+ if (set)
+ linkmode_set_bit(nr, addr);
+ else
+ linkmode_clear_bit(nr, addr);
+}
+
static inline void linkmode_change_bit(int nr, volatile unsigned long *addr)
{
__change_bit(nr, addr);