diff options
author | Vladimir Oltean <vladimir.oltean@nxp.com> | 2022-11-15 04:18:45 +0300 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2022-11-18 08:16:42 +0300 |
commit | e8666130b995a6a1a99c319d33fae2046213c39b (patch) | |
tree | 3787020961d1255b11386d9fe32a9ef232868417 /net/dsa/dsa_priv.h | |
parent | 94793a56b3df0ff2b8c5680f926c19effd8b9ccc (diff) | |
download | linux-e8666130b995a6a1a99c319d33fae2046213c39b.tar.xz |
net: dsa: strip sysfs "tagging" string of trailing newline
Currently, dsa_find_tagger_by_name() uses sysfs_streq() which works both
with strings that contain \n at the end (echo ocelot > .../dsa/tagging)
and with strings that don't (printf ocelot > .../dsa/tagging).
There will be a problem once we'll want to construct the modalias string
based on which we auto-load the protocol kernel module. If the sysfs
buffer ends in a newline, we need to strip it first. This is a
preparatory patch specifically for that.
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Tested-by: Michael Walle <michael@walle.cc>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/dsa/dsa_priv.h')
-rw-r--r-- | net/dsa/dsa_priv.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/dsa/dsa_priv.h b/net/dsa/dsa_priv.h index 020386ff0db9..4559c0ee39d0 100644 --- a/net/dsa/dsa_priv.h +++ b/net/dsa/dsa_priv.h @@ -245,7 +245,7 @@ struct dsa_slave_priv { /* dsa.c */ const struct dsa_device_ops *dsa_tag_driver_get(int tag_protocol); void dsa_tag_driver_put(const struct dsa_device_ops *ops); -const struct dsa_device_ops *dsa_find_tagger_by_name(const char *buf); +const struct dsa_device_ops *dsa_find_tagger_by_name(const char *name); bool dsa_db_equal(const struct dsa_db *a, const struct dsa_db *b); |