diff options
| -rw-r--r-- | drivers/net/phy/phy_device.c | 5 | ||||
| -rw-r--r-- | include/linux/phy.h | 4 |
2 files changed, 7 insertions, 2 deletions
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index bf3ce48a1e5d..46c86725a693 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c | |||
| @@ -2255,6 +2255,11 @@ int phy_driver_register(struct phy_driver *new_driver, struct module *owner) | |||
| 2255 | { | 2255 | { |
| 2256 | int retval; | 2256 | int retval; |
| 2257 | 2257 | ||
| 2258 | if (WARN_ON(!new_driver->features)) { | ||
| 2259 | pr_err("%s: Driver features are missing\n", new_driver->name); | ||
| 2260 | return -EINVAL; | ||
| 2261 | } | ||
| 2262 | |||
| 2258 | new_driver->mdiodrv.flags |= MDIO_DEVICE_IS_PHY; | 2263 | new_driver->mdiodrv.flags |= MDIO_DEVICE_IS_PHY; |
| 2259 | new_driver->mdiodrv.driver.name = new_driver->name; | 2264 | new_driver->mdiodrv.driver.name = new_driver->name; |
| 2260 | new_driver->mdiodrv.driver.bus = &mdio_bus_type; | 2265 | new_driver->mdiodrv.driver.bus = &mdio_bus_type; |
diff --git a/include/linux/phy.h b/include/linux/phy.h index 55114657a577..ef20aeea10cc 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h | |||
| @@ -469,8 +469,8 @@ struct phy_device { | |||
| 469 | * only works for PHYs with IDs which match this field | 469 | * only works for PHYs with IDs which match this field |
| 470 | * name: The friendly name of this PHY type | 470 | * name: The friendly name of this PHY type |
| 471 | * phy_id_mask: Defines the important bits of the phy_id | 471 | * phy_id_mask: Defines the important bits of the phy_id |
| 472 | * features: A list of features (speed, duplex, etc) supported | 472 | * features: A mandatory list of features (speed, duplex, etc) |
| 473 | * by this PHY | 473 | * supported by this PHY |
| 474 | * flags: A bitfield defining certain other features this PHY | 474 | * flags: A bitfield defining certain other features this PHY |
| 475 | * supports (like interrupts) | 475 | * supports (like interrupts) |
| 476 | * | 476 | * |
