Re: [PATCH v3 01/11] firmware: raspberrypi: Introduce devm_rpi_firmware_get()

2020-11-10 Thread Nicolas Saenz Julienne
Hi Bartosz, thanks for the feedback. On Thu, 2020-11-05 at 10:42 +0100, Bartosz Golaszewski wrote: > On Thu, Nov 5, 2020 at 10:28 AM Nicolas Saenz Julienne > wrote: > > Hi Bartosz, thanks for the review. > > > > On Thu, 2020-11-05 at 10:13 +0100, Bartosz Golaszewski wrote: > > > > +/** > > > > +

Re: [PATCH v3 01/11] firmware: raspberrypi: Introduce devm_rpi_firmware_get()

2020-11-05 Thread Bartosz Golaszewski
On Thu, Nov 5, 2020 at 10:28 AM Nicolas Saenz Julienne wrote: > > Hi Bartosz, thanks for the review. > > On Thu, 2020-11-05 at 10:13 +0100, Bartosz Golaszewski wrote: > > > +/** > > > + * devm_rpi_firmware_get - Get pointer to rpi_firmware structure. > > > + * @firmware_node:Pointer to the fir

Re: [PATCH v3 01/11] firmware: raspberrypi: Introduce devm_rpi_firmware_get()

2020-11-05 Thread Nicolas Saenz Julienne
Hi Bartosz, thanks for the review. On Thu, 2020-11-05 at 10:13 +0100, Bartosz Golaszewski wrote: > > +/** > > + * devm_rpi_firmware_get - Get pointer to rpi_firmware structure. > > + * @firmware_node:Pointer to the firmware Device Tree node. > > + * > > + * Returns NULL is the firmware device

Re: [PATCH v3 01/11] firmware: raspberrypi: Introduce devm_rpi_firmware_get()

2020-11-05 Thread Bartosz Golaszewski
On Wed, Nov 4, 2020 at 11:39 AM Nicolas Saenz Julienne wrote: > > When unbinding the firmware device we need to make sure it has no > consumers left. Otherwise we'd leave them with a firmware handle > pointing at freed memory. > > Keep a reference count of all consumers and introduce > devm_rpi_fi

[PATCH v3 01/11] firmware: raspberrypi: Introduce devm_rpi_firmware_get()

2020-11-04 Thread Nicolas Saenz Julienne
When unbinding the firmware device we need to make sure it has no consumers left. Otherwise we'd leave them with a firmware handle pointing at freed memory. Keep a reference count of all consumers and introduce devm_rpi_firmware_get() which will automatically decrease the reference count upon unbi