On Fri, Sep 18, 2020 at 07:25:32PM +0200, Marc Kleine-Budde wrote: > +static int > +mcp25xxfd_regmap_nocrc_update_bits(void *context, unsigned int reg, > + unsigned int mask, unsigned int val) > +{ This doesn't look like the hardware has an update_bits() operation so why is there a driver specific implementation? > +static int > +mcp25xxfd_regmap_init_nocrc(struct mcp25xxfd_priv *priv) > +{ > + if (!priv->map_nocrc) { > + struct regmap *map; > + > + map = devm_regmap_init(&priv->spi->dev, &mcp25xxfd_bus_nocrc, > + priv->spi, &mcp25xxfd_regmap_nocrc); Why all these checks to see if things might already be allocated? > +static void mcp25xxfd_regmap_destroy_nocrc(struct mcp25xxfd_priv *priv) > +{ > + if (priv->map_buf_nocrc_rx) { > + devm_kfree(&priv->spi->dev, priv->map_buf_nocrc_rx); > + priv->map_buf_nocrc_rx = NULL; > + } Why explicitly free managed allocations like this?
Attachment:
signature.asc
Description: PGP signature