]> git.baikalelectronics.ru Git - kernel.git/commit
phy: intel: fix enum type mismatch warning
authorArnd Bergmann <arnd@arndb.de>
Wed, 27 May 2020 13:45:06 +0000 (15:45 +0200)
committerVinod Koul <vkoul@kernel.org>
Wed, 24 Jun 2020 12:11:40 +0000 (17:41 +0530)
commit0d5f5587851a4695fea72063059d318f4e63c157
tree064c44caddd91a8312cfe94a02d16feb969e77cb
parent7a2aa662c605f19d3bfcce319d9c0bbc918cf5fa
phy: intel: fix enum type mismatch warning

clang points out that a local variable is initialized with
an enum value of the wrong type:

drivers/phy/intel/phy-intel-combo.c:202:34: error: implicit conversion from enumeration type 'enum intel_phy_mode' to different enumeration type 'enum intel_combo_mode' [-Werror,-Wenum-conversion]
        enum intel_combo_mode cb_mode = PHY_PCIE_MODE;
                              ~~~~~~~   ^~~~~~~~~~~~~

>From reading the code, it seems that this was not only the
wrong type, but not even supposed to be a code path that can
happen in practice.

Change the code to have no default phy mode but instead return an
error for invalid input.

Fixes: 3ed7b9299434 ("phy: intel: Add driver support for ComboPhy")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Dilip Kota <eswara.kota@linux.intel.com>
Reviewed-by: Nathan Chancellor <natechancellor@gmail.com>
Link: https://lore.kernel.org/r/20200527134518.908624-1-arnd@arndb.de
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/phy/intel/phy-intel-combo.c