tree: https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git gpio-descriptor-net head: 32bc32905edf42e9625e21dd71b4c27f3b623e00 commit: 32bc32905edf42e9625e21dd71b4c27f3b623e00 [3/3] net: phy: fixed-phy: Drop GPIO from fixed_phy_add() config: x86_64-allmodconfig (attached as .config) compiler: gcc-7 (Debian 7.3.0-1) 7.3.0 reproduce: git checkout 32bc32905edf42e9625e21dd71b4c27f3b623e00 # save the attached .config to linux build tree make ARCH=x86_64 All error/warnings (new ones prefixed by >>): >> drivers/net/phy/fixed_phy.c:53:15: error: incorrect type in conditional drivers/net/phy/fixed_phy.c:53:15: got struct gpio_desc link_gpiod include/linux/slab.h:332:43: warning: dubious: x & !y >> drivers/net/phy/fixed_phy.c:141:24: warning: incorrect type in assignment (invalid types) drivers/net/phy/fixed_phy.c:166:31: error: incorrect type in conditional drivers/net/phy/fixed_phy.c:166:31: got struct gpio_desc link_gpiod drivers/net/phy/fixed_phy.c:43:19: error: field 'link_gpiod' has incomplete type struct gpio_desc link_gpiod; ^~~~~~~~~~ vim +53 drivers/net/phy/fixed_phy.c 50 51 static void fixed_phy_update(struct fixed_phy *fp) 52 { > 53 if (fp->link_gpiod) 54 fp->status.link = !!gpiod_get_value_cansleep(fp->link_gpiod); 55 } 56 57 static int fixed_mdio_read(struct mii_bus *bus, int phy_addr, int reg_num) 58 { 59 struct fixed_mdio_bus *fmb = bus->priv; 60 struct fixed_phy *fp; 61 62 list_for_each_entry(fp, &fmb->phys, node) { 63 if (fp->addr == phy_addr) { 64 struct fixed_phy_status state; 65 int s; 66 67 do { 68 s = read_seqcount_begin(&fp->seqcount); 69 /* Issue callback if user registered it. */ 70 if (fp->link_update) { 71 fp->link_update(fp->phydev->attached_dev, 72 &fp->status); 73 fixed_phy_update(fp); 74 } 75 state = fp->status; 76 } while (read_seqcount_retry(&fp->seqcount, s)); 77 78 return swphy_read_reg(reg_num, &state); 79 } 80 } 81 82 return 0xFFFF; 83 } 84 85 static int fixed_mdio_write(struct mii_bus *bus, int phy_addr, int reg_num, 86 u16 val) 87 { 88 return 0; 89 } 90 91 /* 92 * If something weird is required to be done with link/speed, 93 * network driver is able to assign a function to implement this. 94 * May be useful for PHY's that need to be software-driven. 95 */ 96 int fixed_phy_set_link_update(struct phy_device *phydev, 97 int (*link_update)(struct net_device *, 98 struct fixed_phy_status *)) 99 { 100 struct fixed_mdio_bus *fmb = &platform_fmb; 101 struct fixed_phy *fp; 102 103 if (!phydev || !phydev->mdio.bus) 104 return -EINVAL; 105 106 list_for_each_entry(fp, &fmb->phys, node) { 107 if (fp->addr == phydev->mdio.addr) { 108 fp->link_update = link_update; 109 fp->phydev = phydev; 110 return 0; 111 } 112 } 113 114 return -ENOENT; 115 } 116 EXPORT_SYMBOL_GPL(fixed_phy_set_link_update); 117 118 static int fixed_phy_add_gpiod(unsigned int irq, int phy_addr, 119 struct fixed_phy_status *status, 120 struct gpio_desc *gpiod) 121 { 122 int ret; 123 struct fixed_mdio_bus *fmb = &platform_fmb; 124 struct fixed_phy *fp; 125 126 ret = swphy_validate_state(status); 127 if (ret < 0) 128 return ret; 129 130 fp = kzalloc(sizeof(*fp), GFP_KERNEL); 131 if (!fp) 132 return -ENOMEM; 133 134 seqcount_init(&fp->seqcount); 135 136 if (irq != PHY_POLL) 137 fmb->mii_bus->irq[phy_addr] = irq; 138 139 fp->addr = phy_addr; 140 fp->status = *status; > 141 fp->link_gpiod = gpiod; 142 143 fixed_phy_update(fp); 144 145 list_add_tail(&fp->node, &fmb->phys); 146 147 return 0; 148 } 149 --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation
Attachment:
.config.gz
Description: application/gzip