From: Konrad Knitter Date: Wed, 6 Nov 2024 09:36:42 +0000 (+0100) Subject: devlink: add devl guard X-Git-Tag: v6.14-rc1~162^2~33^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0502bd2e06055646f43871f76fb7bdd57f7c0939;p=thirdparty%2Flinux.git devlink: add devl guard Add devl guard for scoped_guard(). Example usage: scoped_guard(devl, priv_to_devlink(pf)) { err = init_devlink(pf); if (err) return err; } Co-developed-by: Przemek Kitszel Signed-off-by: Przemek Kitszel Signed-off-by: Konrad Knitter Tested-by: Pucha Himasekhar Reddy (A Contingent worker at Intel) Signed-off-by: Tony Nguyen --- diff --git a/include/net/devlink.h b/include/net/devlink.h index fc79fe2297a14..b8783126c1ed2 100644 --- a/include/net/devlink.h +++ b/include/net/devlink.h @@ -1535,6 +1535,7 @@ int devl_trylock(struct devlink *devlink); void devl_unlock(struct devlink *devlink); void devl_assert_locked(struct devlink *devlink); bool devl_lock_is_held(struct devlink *devlink); +DEFINE_GUARD(devl, struct devlink *, devl_lock(_T), devl_unlock(_T)); struct ib_device;