From: Bartosz Golaszewski
Shrink pmbus code by using devm_hwmon_device_register_with_groups()
and devm_krealloc() instead of their non-managed variants.
Signed-off-by: Bartosz Golaszewski
Acked-by: Guenter Roeck
---
drivers/hwmon/pmbus/pmbus_core.c | 28 +---
1 file
From: Bartosz Golaszewski
Implement the managed variant of krealloc(). This function works with
all memory allocated by devm_kmalloc() (or devres functions using it
implicitly like devm_kmemdup(), devm_kstrdup() etc.).
Managed realloc'ed chunks can be manually released with devm_kfree
From: Bartosz Golaszewski
Use the managed variant of krealloc() and shrink the code a bit.
Signed-off-by: Bartosz Golaszewski
Acked-by: Jonathan Cameron
---
drivers/iio/adc/xilinx-xadc-core.c | 16
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/iio/adc
On Fri, Aug 14, 2020 at 5:04 AM Kent Gibson wrote:
>
> Add support for the GPIO_V2_LINE_SET_VALUES_IOCTL.
>
> Signed-off-by: Kent Gibson
> ---
Just the same thing as with patch 10/20 regarding the
_locked/_unlocked suffix. I don't have other comments, looks good to
me.
Bart
[snip]
On Fri, Aug 14, 2020 at 5:04 AM Kent Gibson wrote:
>
> Add support for GPIO_V2_LINE_SET_CONFIG_IOCTL, the uAPI v2
> line set config ioctl.
>
> Signed-off-by: Kent Gibson
> ---
> drivers/gpio/gpiolib-cdev.c | 92 +
> 1 file changed, 92 insertions(+)
>
> diff
On Fri, Aug 14, 2020 at 5:04 AM Kent Gibson wrote:
>
> Add support for edge detection to lines requested using
> GPIO_V2_GET_LINE_IOCTL.
>
> Signed-off-by: Kent Gibson
> ---
>
> The edge_detector implementation is based on the v1 lineevent implementation.
>
> drivers/gpio/gpiolib-cdev.c | 316
On Sat, Aug 15, 2020 at 3:21 PM Kent Gibson wrote:
>
> On Sat, Aug 15, 2020 at 09:21:22AM +0200, Bartosz Golaszewski wrote:
> > On Sat, Aug 15, 2020 at 8:53 AM Kent Gibson wrote:
> > >
> > > On Fri, Aug 14, 2020 at 09:31:29PM +0200, Bartosz Golaszewski wrote:
> &
On Fri, Aug 14, 2020 at 5:04 AM Kent Gibson wrote:
>
> Add support for GPIO_V2_GET_LINEINFO_IOCTL and
> GPIO_V2_GET_LINEINFO_WATCH_IOCTL.
>
> Signed-off-by: Kent Gibson
> ---
>
> The core of this change is the event kfifo switching to contain
> struct gpioline_info_changed_v2, instead of v1 as
On Sat, Aug 15, 2020 at 8:53 AM Kent Gibson wrote:
>
> On Fri, Aug 14, 2020 at 09:31:29PM +0200, Bartosz Golaszewski wrote:
> > On Fri, Aug 14, 2020 at 5:04 AM Kent Gibson wrote:
> > >
> > > Add support for requesting lines using the GPIO_V2_GET_LINE_IOCTL, and
On Fri, Aug 14, 2020 at 5:04 AM Kent Gibson wrote:
>
> Add support for requesting lines using the GPIO_V2_GET_LINE_IOCTL, and
> returning their current values using GPIO_V2_LINE_GET_VALUES_IOCTL.
>
> Signed-off-by: Kent Gibson
> ---
Hi Kent,
not many comments here, just a couple minor details
On Wed, Aug 12, 2020 at 9:25 PM Wolfram Sang wrote:
>
>
> > Wolfram says. From my side: I'd prefer to see the
> > disable_i2c_core_irq_mapping converted to flags first and then the
> > flags extended with whatever you need. disable_i2c_core_irq_mapping
> > could also be removed AFAICT - nobody
On Tue, Aug 11, 2020 at 10:00 AM Sakari Ailus wrote:
>
> Hi Bartosz,
>
> On Mon, Aug 10, 2020 at 08:12:00PM +0200, Bartosz Golaszewski wrote:
> > On Mon, Aug 10, 2020 at 10:26 AM Sakari Ailus wrote:
> > >
> >
> > [snip]
> >
> > > >
> &g
On Wed, Aug 12, 2020 at 3:55 AM Kent Gibson wrote:
>
> On Tue, Aug 11, 2020 at 09:11:41PM +0200, Bartosz Golaszewski wrote:
> > On Sun, Aug 9, 2020 at 3:26 PM Kent Gibson wrote:
> > >
> [snip]
> > >
> > > +/*
> > > + * Maximum number of requ
On Sun, Aug 9, 2020 at 3:26 PM Kent Gibson wrote:
>
> Add a new version of the uAPI to address existing 32/64-bit alignment
> issues, add support for debounce and event sequence numbers, allow
> requested lines with different configurations, and provide some future
> proofing by adding padding
> .name = "cpld_video",
> },
> - .probe = cpld_video_probe,
> + .probe_new = cpld_video_probe,
> .remove = cpld_video_remove,
> .id_table = cpld_video_id,
> };
>
> base-commit: bcf876870b95592b52519ed4aafcf9d95999bc9c
> --
> 2.20.1
>
Reviewed-by: Bartosz Golaszewski
On Mon, Aug 10, 2020 at 10:26 AM Sakari Ailus wrote:
>
[snip]
> >
> > Rafael: I think that there are two issues with patch 1/5:
> > 1. It adds a very specific boolean flag to a structure that's meant to
> > be very general. As I pointed out in the i2c patch: at the very least
> > this could be
On Thu, Aug 6, 2020 at 3:15 AM Kent Gibson wrote:
>
> On Wed, Aug 05, 2020 at 01:18:53PM +0800, Kent Gibson wrote:
> > On Tue, Aug 04, 2020 at 07:42:34PM +0200, Bartosz Golaszewski wrote:
> > > On Sat, Jul 25, 2020 at 6:20 AM Kent Gibson wrote:
>
> [snip]
>
>
On Wed, Aug 5, 2020 at 7:19 AM Kent Gibson wrote:
>
[snip]
> > >
> > > +/*
> > > + * Maximum number of requested lines.
> > > + *
> > > + * Must be a multiple of 8 to ensure 32/64-bit alignment of structs.
> > > + */
> > > +#define GPIOLINES_MAX 64
> > > +
> > > +/* The number of __u64 required
On Wed, Aug 5, 2020 at 4:36 PM Jean Delvare wrote:
>
> Hi Bartosz,
>
> On Tue, 17 Mar 2020 15:32:56 +0100, Bartosz Golaszewski wrote:
> > wt., 17 mar 2020 o 15:14 Jean Delvare napisał(a):
> > > Before I start implementing the idea above, I would like to know if
> &g
On Sat, Jul 25, 2020 at 6:22 AM Kent Gibson wrote:
>
> Update uAPI documentation to deprecate v1 structs and ioctls.
>
> Signed-off-by: Kent Gibson
> ---
> include/uapi/linux/gpio.h | 26 ++
> 1 file changed, 26 insertions(+)
>
> diff --git a/include/uapi/linux/gpio.h
On Sat, Jul 25, 2020 at 6:21 AM Kent Gibson wrote:
>
> Add support for edge detection to lines requested using
> GPIO_GET_LINE_IOCTL.
>
> Signed-off-by: Kent Gibson
> ---
[snip!]
> +
> +static irqreturn_t edge_irq_thread(int irq, void *p)
> +{
> + struct edge_detector *edet = p;
> +
On Tue, Aug 4, 2020 at 1:01 AM Kent Gibson wrote:
>
[snip]
>
> > Also: I just started going through the patches - nice idea with the
> > GPIO attributes, I really like it. Although I need to give it a longer
> > thought tomorrow - I'm wondering if we can maybe unify them and the
> > flags.
> >
On Sat, Jul 25, 2020 at 6:20 AM Kent Gibson wrote:
>
> Add a new version of the uAPI to address existing 32/64-bit alignment
> issues, add support for debounce and event sequence numbers, and provide
> some future proofing by adding padding reserved for future use.
>
> The alignment issue relates
On Sun, Aug 2, 2020 at 5:32 AM Kent Gibson wrote:
>
> On Fri, Jul 31, 2020 at 06:05:10PM +0200, Bartosz Golaszewski wrote:
> > On Sun, Jul 26, 2020 at 3:12 AM Kent Gibson wrote:
[snip!]
> > > >
> > > > > +static u64 gpioline_config_flags(struct gpiol
On Sun, Aug 2, 2020 at 11:32 AM Kent Gibson wrote:
>
> On Sun, Aug 02, 2020 at 11:31:58AM +0800, Kent Gibson wrote:
> > On Fri, Jul 31, 2020 at 06:05:10PM +0200, Bartosz Golaszewski wrote:
> > > On Sun, Jul 26, 2020 at 3:12
On Sun, Aug 2, 2020 at 12:42 PM Andy Shevchenko
wrote:
>
[snip]
>
> I was thinking about this bit... Shouldn't we rather issue a simple
> dev_warn() and return the existing pointer?
> For example in some cases we might want to have resources coming
> either from heap or from constant. Then, if
From: Bartosz Golaszewski
Hi Greg, Andy,
this is a reworked version of devm_krealloc(). This time without the risk
of sleeping with spinlock taken. I noticed that devres_lock is only there
to protect the integrity of the devres list - we can assume users are sane
enough to not devm_kfree
From: Bartosz Golaszewski
Implement the managed variant of krealloc(). This function works with
all memory allocated by devm_kmalloc() (or devres functions using it
implicitly like devm_kmemdup(), devm_kstrdup() etc.).
Managed realloc'ed chunks can be manually released with devm_kfree
From: Bartosz Golaszewski
Use the managed variant of krealloc() and shrink the code a bit.
Signed-off-by: Bartosz Golaszewski
Acked-by: Jonathan Cameron
---
drivers/iio/adc/xilinx-xadc-core.c | 16
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/iio/adc
From: Bartosz Golaszewski
Shrink pmbus code by using devm_hwmon_device_register_with_groups()
and devm_krealloc() instead of their non-managed variants.
Signed-off-by: Bartosz Golaszewski
Acked-by: Guenter Roeck
---
drivers/hwmon/pmbus/pmbus_core.c | 28 +---
1 file
From: Bartosz Golaszewski
PHYLIB is not selected by the mvusb driver but it uses mdio devres
helpers. Explicitly select MDIO_DEVRES in this driver's Kconfig entry.
Reported-by: kernel test robot
Fixes: 1814cff26739 ("net: phy: add a Kconfig option for mdio_devres")
Signed-off-b
On Sun, Jul 26, 2020 at 3:12 AM Kent Gibson wrote:
>
[snip]
> >
> > > +static bool padding_not_zeroed(__u32 *padding, int pad_size)
> > > +{
> > > + int i, sum = 0;
> > > +
> > > + for (i = 0; i < pad_size; i++)
> > > + sum |= padding[i];
> > > +
> > > + return
struct device *dev, struct gpio_chip *gc,
> - void *data);
> +extern int devm_gpiochip_add_data_with_key(struct device *dev, struct
> gpio_chip *gc, void *data,
> + struct lock_class_key *lock_key,
> + struct lock_class_key
> *request_key);
>
> extern struct gpio_chip *gpiochip_find(void *data,
> int (*match)(struct gpio_chip *gc, void *data));
> --
> 2.27.0
>
Looks good to me and the previous code indeed looks buggy.
Reviewed-by: Bartosz Golaszewski
On Tue, Jul 28, 2020 at 3:58 PM Arnd Bergmann wrote:
>
> On Tue, Jul 28, 2020 at 3:06 PM Dan Carpenter
> wrote:
> >
> > On Tue, Jul 28, 2020 at 02:22:29PM +0200, Linus Walleij wrote:
> > > On Mon, Jul 27, 2020 at 3:17 PM Dan Carpenter
> > > wrote:
> > >
> > > > Here are my latest warnings on
On Wed, Jul 15, 2020 at 11:25 AM Bartosz Golaszewski wrote:
>
> From: Bartosz Golaszewski
>
> Implement the managed variant of krealloc(). This function works with
> all memory allocated by devm_kmalloc() (or devres functions using it
> implicitly like devm_kmemdup(),
on line 30 - I thought it was a doc line
> drivers/iio/dummy/iio_dummy_evgen.c:42: warning: Function parameter or
> member 'irq_sim_domain' not described in 'iio_dummy_eventgen'
>
> Cc: Marc Zyngier
> Cc: Bartosz Golaszewski
> Signed-off-by: Lee Jones
> ---
> drivers/iio/du
vm_nand_mirror_pattern[] = { '1', 't', 'b', 'B' };
>
> --
> 2.25.1
>
Reviewed-by: Bartosz Golaszewski
From: Bartosz Golaszewski
Regular krealloc() obviously can't work with managed memory. This series
implements devm_krealloc() and adds the first users with hope that this
helper will be adopted by other drivers currently using non-managed
krealloc().
Some additional changes to the code modified
From: Bartosz Golaszewski
Implement the managed variant of krealloc(). This function works with
all memory allocated by devm_kmalloc() (or devres functions using it
implicitly like devm_kmemdup(), devm_kstrdup() etc.).
Managed realloc'ed chunks can be manually released with devm_kfree
From: Bartosz Golaszewski
Shrink pmbus code by using devm_hwmon_device_register_with_groups()
and devm_krealloc() instead of their non-managed variants.
Signed-off-by: Bartosz Golaszewski
Acked-by: Guenter Roeck
---
drivers/hwmon/pmbus/pmbus_core.c | 28 +---
1 file
From: Bartosz Golaszewski
Use the managed variant of krealloc() and shrink the code a bit.
Signed-off-by: Bartosz Golaszewski
---
drivers/iio/adc/xilinx-xadc-core.c | 16
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/iio/adc/xilinx-xadc-core.c
b
On Mon, Jul 13, 2020 at 9:29 PM Andy Shevchenko
wrote:
>
> On Mon, Jul 13, 2020 at 04:59:32PM +0200, Bartosz Golaszewski wrote:
> > From: Bartosz Golaszewski
> >
> > Implement the managed variant of krealloc(). This function works with
> > all memory allocate
From: Bartosz Golaszewski
PHYLIB is not selected by mdio-mscc-miim but it uses mdio devres helpers.
Explicitly select MDIO_DEVRES in this driver's Kconfig entry.
Reported-by: kernel test robot
Fixes: 1814cff26739 ("net: phy: add a Kconfig option for mdio_devres")
Signed-off-b
From: Bartosz Golaszewski
Shrink pmbus code by using devm_hwmon_device_register_with_groups()
and devm_krealloc() instead of their non-managed variants.
Signed-off-by: Bartosz Golaszewski
Acked-by: Guenter Roeck
---
drivers/hwmon/pmbus/pmbus_core.c | 28 +---
1 file
From: Bartosz Golaszewski
Regular krealloc() obviously can't work with managed memory. This series
implements devm_krealloc() and adds the first users with hope that this
helper will be adopted by other drivers currently using non-managed
krealloc().
Some additional changes to the code modified
From: Bartosz Golaszewski
Use the managed variant of krealloc() and shrink the code a bit.
Signed-off-by: Bartosz Golaszewski
---
drivers/iio/adc/xilinx-xadc-core.c | 16
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/iio/adc/xilinx-xadc-core.c
b
From: Bartosz Golaszewski
Implement the managed variant of krealloc(). This function works with
all memory allocated by devm_kmalloc() (or devres functions using it
implicitly like devm_kmemdup(), devm_kstrdup() etc.).
Managed realloc'ed chunks can be manually released with devm_kfree
On Sat, Jul 11, 2020 at 5:08 PM Andy Shevchenko
wrote:
>
> On Fri, Jul 10, 2020 at 7:17 PM Bartosz Golaszewski wrote:
> >
> > From: Bartosz Golaszewski
> >
> > Implement the managed variant of krealloc(). This function works with
> > all memory allocated by
On Fri, Jul 10, 2020 at 6:11 PM Jon Hunter wrote:
>
>
> On 10/07/2020 17:03, Bartosz Golaszewski wrote:
> > On Fri, Jul 10, 2020 at 3:46 PM Jon Hunter wrote:
> >>
> >> Hi Bartosz,
> >>
> >> On 29/06/2020 07:50, Bartosz Golaszewski wrote
From: Bartosz Golaszewski
Shrink pmbus code by using devm_hwmon_device_register_with_groups()
and devm_krealloc() instead of their non-managed variants.
Signed-off-by: Bartosz Golaszewski
Acked-by: Guenter Roeck
---
drivers/hwmon/pmbus/pmbus_core.c | 28 +---
1 file
From: Bartosz Golaszewski
Hi Greg,
As discussed, resending the remaining devm_krealloc() patches.
===
Regular krealloc() obviously can't work with managed memory. This series
implements devm_krealloc() and adds the first users with hope that this
helper will be adopted by other drivers
From: Bartosz Golaszewski
Use the managed variant of krealloc() and shrink the code a bit.
Signed-off-by: Bartosz Golaszewski
---
drivers/iio/adc/xilinx-xadc-core.c | 16
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/iio/adc/xilinx-xadc-core.c
b
From: Bartosz Golaszewski
Implement the managed variant of krealloc(). This function works with
all memory allocated by devm_kmalloc() (or devres functions using it
implicitly like devm_kmemdup(), devm_kstrdup() etc.).
Managed realloc'ed chunks can be manually released with devm_kfree
On Fri, Jul 10, 2020 at 3:46 PM Jon Hunter wrote:
>
> Hi Bartosz,
>
> On 29/06/2020 07:50, Bartosz Golaszewski wrote:
> > From: Bartosz Golaszewski
> >
> > Make devm_kmalloc() behave similarly to non-managed kmalloc(): return
> > ZERO_SIZE_PTR when re
On Wed, Jul 8, 2020 at 6:18 AM Kent Gibson wrote:
>
> This collection of patches provides improvements to or
> address minor problems in gpiolib-cdev.
>
> The majority of the patches (1-7, 9-11) have been pulled directly from
> my "gpio: cdev: add uAPI V2" patch set, as they are not related to
On Wed, Jul 8, 2020 at 6:19 AM Kent Gibson wrote:
>
> Replace usage of atomic_notifier_call_chain with
> blocking_notifier_call_chain as the notifier function,
> lineinfo_changed_notify, calls gpio_desc_to_lineinfo,
> which calls pinctrl_gpio_can_use_line, which can sleep.
>
> The chain isn't
quot;INT3499",(kernel_ulong_t)_data_INT3499 },
> { "TPF0001",(kernel_ulong_t)_data_24c1024 },
> { /* END OF LIST */ }
Acked-by: Bartosz Golaszewski
Please, drop the "Re:" prefix from the subject next time, I nearly
missed this in my inbox.
Thanks!
Bartosz
On Thu, Jul 2, 2020 at 3:11 PM Bartosz Golaszewski wrote:
>
> On Thu, Jul 2, 2020 at 2:42 PM Greg Kroah-Hartman
> wrote:
> >
> > On Mon, Jun 29, 2020 at 08:50:07AM +0200, Bartosz Golaszewski wrote:
> > > From: Bartosz Golaszewski
> > >
> >
On Sun, Jul 5, 2020 at 3:31 PM Sungbo Eo wrote:
>
> NXP PCA9570 is a 4-bit I2C GPO expander without interrupt functionality.
> Its ports are controlled only by a data byte without register address.
>
> Datasheet: https://www.nxp.com/docs/en/data-sheet/PCA9570.pdf
>
> Signed-off-by: Sungbo Eo
>
From: Bartosz Golaszewski
If phylib is built as a module and CONFIG_MDIO_DEVICE is 'y', the
mdio_device and mdio_bus code will be in the phylib module, not in the
kernel image. Meanwhile we build mdio_devres depending on the
CONFIG_MDIO_DEVICE symbol, so if it's 'y', it will go into the kernel
From: Bartosz Golaszewski
Use the managed variant of krealloc() and shrink the code a bit.
Signed-off-by: Bartosz Golaszewski
---
NOTE: this patch depends on the series adding devm_krealloc() which is
not yet accepted.
Greg,
here's just a quick example of a second user of devm_krealloc
On Thu, Jul 2, 2020 at 2:42 PM Greg Kroah-Hartman
wrote:
>
> On Mon, Jun 29, 2020 at 08:50:07AM +0200, Bartosz Golaszewski wrote:
> > From: Bartosz Golaszewski
> >
> > Implement the managed variant of krealloc(). This function works with
> > all memory allocate
On Thu, Jul 2, 2020 at 2:44 PM Greg Kroah-Hartman
wrote:
>
> On Mon, Jun 29, 2020 at 08:50:08AM +0200, Bartosz Golaszewski wrote:
> > From: Bartosz Golaszewski
> >
> > Shrink pmbus code by using devm_hwmon_device_register_with_groups()
> > and devm_krealloc(
ff-by: Kent Gibson
Reviewed-by: Bartosz Golaszewski
On Thu, Jun 25, 2020 at 9:58 AM Sungbo Eo wrote:
>
> NXP PCA9570 is 4-bit I2C GPO expander without interrupt functionality.
> Its ports are controlled only by a data byte without register address.
>
> As there is no other driver similar enough to be adapted for it, a new
> driver is introduced
On Tue, Jun 30, 2020 at 8:58 AM Miquel Raynal wrote:
>
> Hi Uwe,
>
> Uwe Kleine-König wrote on Mon, 29 Jun
> 2020 21:50:44 +0200:
>
> > On Mon, Jun 29, 2020 at 04:08:44PM +0200, Miquel Raynal wrote:
> > > Hello Uwe, Thierry,
> > >
> > > Miquel Raynal wrote on Sun, 3 May 2020
> > > 12:54:53
On Thu, Jun 25, 2020 at 12:01 PM Kent Gibson wrote:
>
> On Thu, Jun 25, 2020 at 11:44:30AM +0200, Bartosz Golaszewski wrote:
> > On Wed, Jun 24, 2020 at 4:08 PM Kent Gibson wrote:
> > >
> > > On Wed, Jun 24, 2020 at 04:00:42PM +0200, Bartosz Golaszewski wrote:
&g
set -> desc -> hwgpio is
> the range check in the offset -> desc, but where desc is required you
> still get that, and where desc isn't required it is simpler to perform
> the range check directly.
>
> Signed-off-by: Kent Gibson
Reviewed-by: Bartosz Golaszewski
From: Bartosz Golaszewski
We will perform the same size check in devm_krealloc(). Move the relevant
code into a separate helper.
Signed-off-by: Bartosz Golaszewski
---
drivers/base/devres.c | 14 +++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/drivers/base
From: Bartosz Golaszewski
Implement a managed variant of of_mdiobus_register(). We need to make
mdio_devres into its own module because otherwise we'd hit circular
sumbol dependencies between phylib and of_mdio.
Signed-off-by: Bartosz Golaszewski
---
.../driver-api/driver-model/devres.rst
From: Bartosz Golaszewski
Shrink pmbus code by using devm_hwmon_device_register_with_groups()
and devm_krealloc() instead of their non-managed variants.
Signed-off-by: Bartosz Golaszewski
---
drivers/hwmon/pmbus/pmbus_core.c | 28 +---
1 file changed, 9 insertions
From: Bartosz Golaszewski
Use the preferred coding style for functions returning pointers.
Signed-off-by: Bartosz Golaszewski
---
drivers/base/devres.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/base/devres.c b/drivers/base/devres.c
index 0bbb328bd17f
From: Bartosz Golaszewski
We currently have two managed helpers for mdiobus - devm_mdiobus_alloc()
and devm_mdiobus_register(). The idea behind devres is that the release
callback releases whatever resource the devm function allocates. In the
mdiobus case however there's no devres associated
From: Bartosz Golaszewski
The 'extern' keyword in headers doesn't have any benefit. Remove them
all from the of_mdio.h header.
Signed-off-by: Bartosz Golaszewski
---
include/linux/of_mdio.h | 37 ++---
1 file changed, 18 insertions(+), 19 deletions(-)
diff
From: Bartosz Golaszewski
Make devm_kmalloc() behave similarly to non-managed kmalloc(): return
ZERO_SIZE_PTR when requested size is 0. Update devm_kfree() to handle
this case.
Signed-off-by: Bartosz Golaszewski
---
drivers/base/devres.c | 9 ++---
1 file changed, 6 insertions(+), 3
From: Bartosz Golaszewski
Functions are declared 'extern' implicitly by the compiler. There's no
reason to prepend every prototype with it. Remove the 'extern' keyword
from all function declarations in linux/device.h.
Signed-off-by: Bartosz Golaszewski
---
include/linux/device.h | 223
From: Bartosz Golaszewski
Functions should only be static inline if they're very short. This
devres helper is already over 10 lines and it will grow soon as we'll
be improving upon its approach. Pull it into mdio_devres.c.
Signed-off-by: Bartosz Golaszewski
---
drivers/net/phy/Makefile
erface specific build options to follow.
>
> Suggested-by: Bartosz Golaszewski
> Signed-off-by: Kent Gibson
>
> ---
> drivers/gpio/Kconfig| 16 ++--
> drivers/gpio/Makefile | 2 +-
> drivers/gpio/gpiolib-cdev.h | 15 +++
> 3 fi
From: Bartosz Golaszewski
Implement the managed variant of krealloc(). This function works with
all memory allocated by devm_kmalloc() (or devres functions using it
implicitly like devm_kmemdup(), devm_kstrdup() etc.).
Managed realloc'ed chunks can be manually released with devm_kfree
From: Bartosz Golaszewski
So it seems like there's no support for relaxing certain networking devres
helpers to not require previously allocated structures to also be managed.
However the way mdio devres variants are implemented is still wrong and I
modified my series to address it while keeping
From: Bartosz Golaszewski
This function is not documented. Add a short kerneldoc description.
Signed-off-by: Bartosz Golaszewski
---
drivers/net/phy/mdio_devres.c | 7 +++
1 file changed, 7 insertions(+)
diff --git a/drivers/net/phy/mdio_devres.c b/drivers/net/phy/mdio_devres.c
index
On Tue, Jun 23, 2020 at 6:03 AM Kent Gibson wrote:
>
> Add a build option to allow the removal of the CDEV v1 ABI.
>
> Suggested-by: Bartosz Golaszewski
> Signed-off-by: Kent Gibson
>
> ---
>
> This patch is before the V2 implementation, and is non-functional until
From: Bartosz Golaszewski
We have a devres variant of mdiobus_register() but it's not listed in
devres.rst. Add it under other mdio devm functions.
Signed-off-by: Bartosz Golaszewski
---
Documentation/driver-api/driver-model/devres.rst | 1 +
1 file changed, 1 insertion(+)
diff --git
From: Bartosz Golaszewski
Make it an explicit counterpart to devm_register_netdev() just like we
do with devm_free_netdev() for better clarity.
Signed-off-by: Bartosz Golaszewski
---
net/devres.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/devres.c b/net
From: Bartosz Golaszewski
Shrink the code by using the managed variant of of_mdiobus_register().
Signed-off-by: Bartosz Golaszewski
---
drivers/net/ethernet/mediatek/mtk_star_emac.c | 13 +
1 file changed, 1 insertion(+), 12 deletions(-)
diff --git a/drivers/net/ethernet/mediatek
From: Bartosz Golaszewski
This function may fail. Check its return value and propagate the error
code.
Signed-off-by: Bartosz Golaszewski
---
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 6 +-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/intel/ixgbe
From: Bartosz Golaszewski
The idea behind devres is that the release callbacks are called if
probe fails. As we now check the return value of ixgbe_mii_bus_init(),
we can drop the call devm_mdiobus_free() in error path as the release
callback will be called automatically.
Signed-off-by: Bartosz
From: Bartosz Golaszewski
Regular krealloc() obviously can't work with managed memory. This series
implements devm_krealloc() and adds the first user with hope that this
helper will be adopted by other drivers currently using non-managed
krealloc().
Some additional changes to the code modified
On Sun, Jun 28, 2020 at 7:37 PM Joe Perches wrote:
>
> On Sun, 2020-06-28 at 17:25 +0200, Bartosz Golaszewski wrote:
> > From: Bartosz Golaszewski
> >
> > Memory allocated with kstrdup_const() must not be passed to regular
> > krealloc() as it is not aware o
From: Bartosz Golaszewski
Memory allocated with kstrdup_const() must not be passed to regular
krealloc() as it is not aware of the possibility of the chunk residing
in .rodata. Since there are no potential users of krealloc_const()
at the moment, let's just update the doc to make it explicit
From: Bartosz Golaszewski
Functions are declared 'extern' implicitly by the compiler. There's no
reason to prepend every prototype with it. Remove the 'extern' keyword
from all function declarations in linux/device.h.
Signed-off-by: Bartosz Golaszewski
---
include/linux/device.h | 223
From: Bartosz Golaszewski
Use the preferred coding style for functions returning pointers.
Signed-off-by: Bartosz Golaszewski
---
drivers/base/devres.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/base/devres.c b/drivers/base/devres.c
index 0bbb328bd17f
From: Bartosz Golaszewski
We will perform the same size check in devm_krealloc(). Move the relevant
code into a separate helper.
Signed-off-by: Bartosz Golaszewski
---
drivers/base/devres.c | 14 +++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/drivers/base
From: Bartosz Golaszewski
Implement the managed variant of krealloc(). This function works with
all memory allocated by devm_kmalloc() (or devres functions using it
implicitly like devm_kmemdup(), devm_kstrdup() etc.).
Managed realloc'ed chunks can be manually released with devm_kfree
From: Bartosz Golaszewski
Shrink pmbus code by using devm_hwmon_device_register_with_groups()
and devm_krealloc() instead of their non-managed variants.
Signed-off-by: Bartosz Golaszewski
---
drivers/hwmon/pmbus/pmbus_core.c | 27 +--
1 file changed, 9 insertions
From: Bartosz Golaszewski
Regular krealloc() obviously can't work with managed memory. This series
implements devm_krealloc() and adds the first user with hope that this
helper will be adopted by other drivers currently using non-managed
krealloc().
Some cosmetic changes to the code modified
From: Bartosz Golaszewski
This header refers to struct reset_control but doesn't include any reset
header. The structure definition is probably somehow indirectly pulled in
since no warnings are reported but for the sake of correctness add the
forward declaration for struct reset_control
From: Bartosz Golaszewski
Currently we only call phy_device_reset() if the PHY driver implements
the probe() callback. This is not mandatory and many drivers (e.g.
realtek) don't need probe() for most devices but still can have reset
GPIOs defined. There's no reason to depend on the presence
From: Bartosz Golaszewski
Keeping the headers in alphabetical order is better for readability and
allows to easily see if given header is already included.
Signed-off-by: Bartosz Golaszewski
Reviewed-by: Andrew Lunn
Reviewed-by: Florian Fainelli
---
drivers/net/phy/phy_device.c | 28
From: Bartosz Golaszewski
Previously these patches were submitted as part of a larger series[1]
but since the approach in it will have to be reworked I'm resending
the ones that were non-controversial and have been reviewed for upstream.
Florian suggested a better solution for managing multiple
801 - 900 of 5674 matches
Mail list logo