You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
openwrt/target/linux/ar71xx/patches-4.4/900-mdio_bitbang_ignore_ta_...

33 lines
928 B
Diff

--- a/drivers/net/phy/mdio-bitbang.c
+++ b/drivers/net/phy/mdio-bitbang.c
ar71xx: fix compiler warnings in mdio-bitbang.c for 4.4 Building Linux 4.4 for ar71xx throws the following warnings in drivers/net/phy/mdio-bitbang.c: CC drivers/net/phy/mdio-bitbang.o In file included from include/linux/irqflags.h:14:0, from drivers/net/phy/mdio-bitbang.c:20: drivers/net/phy/mdio-bitbang.c: In function 'mdiobb_read': include/linux/typecheck.h:11:18: warning: comparison of distinct pointer types lacks a cast (void)(&__dummy == &__dummy2); \ ^ include/linux/irqflags.h:63:3: note: in expansion of macro 'typecheck' typecheck(unsigned long, flags); \ ^ include/linux/irqflags.h:124:3: note: in expansion of macro 'raw_local_irq_save' raw_local_irq_save(flags); \ ^ drivers/net/phy/mdio-bitbang.c:162:2: note: in expansion of macro 'local_irq_save' local_irq_save(flags); ^ include/linux/typecheck.h:11:18: warning: comparison of distinct pointer types lacks a cast (void)(&__dummy == &__dummy2); \ ^ include/linux/irqflags.h:68:3: note: in expansion of macro 'typecheck' typecheck(unsigned long, flags); \ ^ include/linux/irqflags.h:126:39: note: in expansion of macro 'raw_local_irq_restore' #define local_irq_restore(flags) do { raw_local_irq_restore(flags); } while (0) ^ drivers/net/phy/mdio-bitbang.c:175:2: note: in expansion of macro 'local_irq_restore' local_irq_restore(flags); ^ drivers/net/phy/mdio-bitbang.c:159:11: warning: unused variable 'i' [-Wunused-variable] int ret, i; ^ In file included from include/linux/irqflags.h:14:0, from drivers/net/phy/mdio-bitbang.c:20: drivers/net/phy/mdio-bitbang.c: In function 'mdiobb_write': include/linux/typecheck.h:11:18: warning: comparison of distinct pointer types lacks a cast (void)(&__dummy == &__dummy2); \ ^ include/linux/irqflags.h:63:3: note: in expansion of macro 'typecheck' typecheck(unsigned long, flags); \ ^ include/linux/irqflags.h:124:3: note: in expansion of macro 'raw_local_irq_save' raw_local_irq_save(flags); \ ^ drivers/net/phy/mdio-bitbang.c:185:2: note: in expansion of macro 'local_irq_save' local_irq_save(flags); ^ include/linux/typecheck.h:11:18: warning: comparison of distinct pointer types lacks a cast (void)(&__dummy == &__dummy2); \ ^ include/linux/irqflags.h:68:3: note: in expansion of macro 'typecheck' typecheck(unsigned long, flags); \ ^ include/linux/irqflags.h:126:39: note: in expansion of macro 'raw_local_irq_restore' #define local_irq_restore(flags) do { raw_local_irq_restore(flags); } while (0) ^ drivers/net/phy/mdio-bitbang.c:200:2: note: in expansion of macro 'local_irq_restore' local_irq_restore(flags); ^ These are caused by the 900-mdio_bitbang_ignore_ta_value and 901-phy-mdio-bitbang-prevent-rescheduling-during-command patches. The first patch removes some code but it does not remove the variable which is used by the removed code only. The second patch adds local_irq_{save,restore} calls. The type of the argument of these calls must be 'unsigned long', but the patch defines the variable as 'long'. Fix both patches to silence the warnings. Signed-off-by: Gabor Juhos <juhosg@freemail.hu>
7 years ago
@@ -155,7 +155,7 @@ static int mdiobb_cmd_addr(struct mdiobb
static int mdiobb_read(struct mii_bus *bus, int phy, int reg)
{
struct mdiobb_ctrl *ctrl = bus->priv;
- int ret, i;
+ int ret;
if (reg & MII_ADDR_C45) {
reg = mdiobb_cmd_addr(ctrl, phy, reg);
@@ -165,19 +165,7 @@ static int mdiobb_read(struct mii_bus *b
ctrl->ops->set_mdio_dir(ctrl, 0);
- /* check the turnaround bit: the PHY should be driving it to zero, if this
- * PHY is listed in phy_ignore_ta_mask as having broken TA, skip that
- */
- if (mdiobb_get_bit(ctrl) != 0 &&
- !(bus->phy_ignore_ta_mask & (1 << phy))) {
- /* PHY didn't drive TA low -- flush any bits it
- * may be trying to send.
- */
- for (i = 0; i < 32; i++)
- mdiobb_get_bit(ctrl);
-
- return 0xffff;
- }
+ mdiobb_get_bit(ctrl);
ret = mdiobb_get_num(ctrl, 16);
mdiobb_get_bit(ctrl);