[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <041a9797-422a-a67a-55e9-692e9c166065@gmail.com>
Date: Fri, 19 Apr 2019 08:30:57 -0700
From: Florian Fainelli <f.fainelli@...il.com>
To: Andrew Lunn <andrew@...n.ch>, David Miller <davem@...emloft.net>
Cc: netdev <netdev@...r.kernel.org>,
Vivien Didelot <vivien.didelot@...il.com>
Subject: Re: [PATCH net-next 08/15] dsa: Keep link list of tag drivers
On 4/17/2019 7:31 PM, Andrew Lunn wrote:
> Let the tag drivers register themselves with the DSA core, keeping
> them in a linked list.
>
> Signed-off-by: Andrew Lunn <andrew@...n.ch>
> ---
[snip]
> int dsa_tag_drivers_register(struct dsa_device_ops *ops[],
> unsigned int count, struct module *owner)
> {
> - return 0;
> + int err, i;
> +
> + for (i = 0; i < count; i++) {
count is unsigned, so i should also be unsigned.
> + err = dsa_tag_driver_register(ops[i], owner);
> + if (err)
> + break;
> + }
> +
> + return err;
> +}
> +
> +static void dsa_tag_driver_unregister(struct dsa_device_ops *ops)
> +{
> + mutex_lock(&dsa_tag_drivers_lock);
> + list_del(&ops->list);
> + mutex_unlock(&dsa_tag_drivers_lock);
> }
> EXPORT_SYMBOL_GPL(dsa_tag_drivers_register);
>
> void dsa_tag_drivers_unregister(struct dsa_device_ops *ops[],
> unsigned int count)
> {
> + int i;
> +
> + for (i = 0; i < count; i++)
> + dsa_tag_driver_unregister(ops[i]);
Likewise.
--
Florian
Powered by blists - more mailing lists