]> git.itanic.dy.fi Git - linux-stable/commit
mfd: dln2: Fix sanity checking for endpoints
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Wed, 26 Feb 2020 14:51:58 +0000 (16:51 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 Apr 2020 14:12:20 +0000 (16:12 +0200)
commit0e6a9fb45b66533dba1c49d0f05ad0efbb79b6a9
tree4428c760b06389fd66239555f6304d4ea8395a11
parent581fc0a6f2f6db2e66c4db6a9c759d43dc2b224b
mfd: dln2: Fix sanity checking for endpoints

[ Upstream commit fb945c95a482200876993977008b67ea658bd938 ]

While the commit 2b8bd606b1e6 ("mfd: dln2: More sanity checking for endpoints")
tries to harden the sanity checks it made at the same time a regression,
i.e.  mixed in and out endpoints. Obviously it should have been not tested on
real hardware at that time, but unluckily it didn't happen.

So, fix above mentioned typo and make device being enumerated again.

While here, introduce an enumerator for magic values to prevent similar issue
to happen in the future.

Fixes: 2b8bd606b1e6 ("mfd: dln2: More sanity checking for endpoints")
Cc: Oliver Neukum <oneukum@suse.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/mfd/dln2.c