On Tue, Jan 14, 2020 at 04:57:55PM +0100, Christian Gromm wrote:
> This patch allocated the mostcore structure dynamically and releases
> the memory in the dedicated release function.
> 
> Signed-off-by: Christian Gromm <christian.gr...@microchip.com>
> ---
> v3:
>       This patch has been added to the series.
> 
>  drivers/staging/most/core.c | 110 
> ++++++++++++++++++++++++--------------------
>  1 file changed, 59 insertions(+), 51 deletions(-)
> 
> diff --git a/drivers/staging/most/core.c b/drivers/staging/most/core.c
> index 4f60c09..92303d0 100644
> --- a/drivers/staging/most/core.c
> +++ b/drivers/staging/most/core.c
> @@ -33,9 +33,10 @@ static struct mostcore {
>       struct device_driver drv;
>       struct bus_type bus;
>       struct list_head comp_list;
> -} mc;
> +} *mc;

Why do you need one single global variable for all of this?  Shouldn't
there be one per "bus controller" that you have in the system?  No other
driver/bus subsystem has a single global state for everything, why is
this unique?

It's good you are making this dynamic, but I would go further and not
make there be one at all, this state should be per-bus.

thanks,

greg k-h
_______________________________________________
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to