Re: [PATCH RFC net-next] net: phy: mxl-gpy: add basic LED support

From: Andrew Lunn
Date: Mon Sep 30 2024 - 08:22:52 EST


> +static int gpy_led_hw_control_set(struct phy_device *phydev, u8 index,
> + unsigned long rules)
> +{
> + int ret;
> + u16 val = 0;

These two should be the other way around.

> +static int gpy_led_polarity_set(struct phy_device *phydev, int index,
> + unsigned long modes)
> +{
> + bool active_low = false;
> + u32 mode;
> +
> + if (index >= GPY_MAX_LEDS)
> + return -EINVAL;
> +
> + for_each_set_bit(mode, &modes, __PHY_LED_MODES_NUM) {
> + switch (mode) {
> + case PHY_LED_ACTIVE_LOW:
> + active_low = true;
> + break;
> + default:
> + return -EINVAL;
> + }
> + }

The return should be indented one more tab.

Andrew

---
pw-bot: cr