27 Sep, 2020
2 commits
-
Various drivers count and iterate over OF children nodes via
of_get_child_count and for_each_child_of_node. Instead they should use
of_get_available_child_count and for_each_available_child_of_node, so
that if a given node has the `status` property set to `disabled`, the
child will be ignored.Signed-off-by: Marek Behún
Cc: Andrew Lunn
Cc: Andrey Utkin
Cc: Baolin Wang
Cc: Baolin Wang
Cc: Benjamin Herrenschmidt
Cc: Christian Mauderer
Cc: Chunyan Zhang
Cc: Dan Murphy
Cc: David Rivshin
Cc: Haojian Zhuang
Cc: H. Nikolaus Schaller
Cc: Michael Ellerman
Cc: Milo Kim
Cc: NeilBrown
Cc: Nikita Travkin
Cc: Orson Zhai
Cc: Paul Mackerras
Cc: Philippe Retornaz
Cc: Riku Voipio
Cc: Simon Guinot
Cc: Simon Shields
Cc: Vasant Hegde
Cc: Xiaotong Lu
Signed-off-by: Pavel Machek -
The dev_of_node function should be preferred.
Signed-off-by: Marek Behún
Cc: Orson Zhai
Cc: Baolin Wang
Cc: Chunyan Zhang
Cc: Sean Wang
Cc: Matthias Brugger
Cc: Riku Voipio
Signed-off-by: Pavel Machek
19 Jun, 2019
1 commit
-
Based on 2 normalized pattern(s):
this program is free software you can redistribute it and or modify
it under the terms of the gnu general public license version 2 as
published by the free software foundationthis program is free software you can redistribute it and or modify
it under the terms of the gnu general public license version 2 as
published by the free software foundation #extracted by the scancode license scanner the SPDX license identifier
GPL-2.0-only
has been chosen to replace the boilerplate/reference in 4122 file(s).
Signed-off-by: Thomas Gleixner
Reviewed-by: Enrico Weigelt
Reviewed-by: Kate Stewart
Reviewed-by: Allison Randal
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190604081206.933168790@linutronix.de
Signed-off-by: Greg Kroah-Hartman
13 Jun, 2018
1 commit
-
The devm_kzalloc() function has a 2-factor argument form, devm_kcalloc().
This patch replaces cases of:devm_kzalloc(handle, a * b, gfp)
with:
devm_kcalloc(handle, a * b, gfp)as well as handling cases of:
devm_kzalloc(handle, a * b * c, gfp)
with:
devm_kzalloc(handle, array3_size(a, b, c), gfp)
as it's slightly less ugly than:
devm_kcalloc(handle, array_size(a, b), c, gfp)
This does, however, attempt to ignore constant size factors like:
devm_kzalloc(handle, 4 * 1024, gfp)
though any constants defined via macros get caught up in the conversion.
Any factors with a sizeof() of "unsigned char", "char", and "u8" were
dropped, since they're redundant.Some manual whitespace fixes were needed in this patch, as Coccinelle
really liked to write "=devm_kcalloc..." instead of "= devm_kcalloc...".The Coccinelle script used for this was:
// Fix redundant parens around sizeof().
@@
expression HANDLE;
type TYPE;
expression THING, E;
@@(
devm_kzalloc(HANDLE,
- (sizeof(TYPE)) * E
+ sizeof(TYPE) * E
, ...)
|
devm_kzalloc(HANDLE,
- (sizeof(THING)) * E
+ sizeof(THING) * E
, ...)
)// Drop single-byte sizes and redundant parens.
@@
expression HANDLE;
expression COUNT;
typedef u8;
typedef __u8;
@@(
devm_kzalloc(HANDLE,
- sizeof(u8) * (COUNT)
+ COUNT
, ...)
|
devm_kzalloc(HANDLE,
- sizeof(__u8) * (COUNT)
+ COUNT
, ...)
|
devm_kzalloc(HANDLE,
- sizeof(char) * (COUNT)
+ COUNT
, ...)
|
devm_kzalloc(HANDLE,
- sizeof(unsigned char) * (COUNT)
+ COUNT
, ...)
|
devm_kzalloc(HANDLE,
- sizeof(u8) * COUNT
+ COUNT
, ...)
|
devm_kzalloc(HANDLE,
- sizeof(__u8) * COUNT
+ COUNT
, ...)
|
devm_kzalloc(HANDLE,
- sizeof(char) * COUNT
+ COUNT
, ...)
|
devm_kzalloc(HANDLE,
- sizeof(unsigned char) * COUNT
+ COUNT
, ...)
)// 2-factor product with sizeof(type/expression) and identifier or constant.
@@
expression HANDLE;
type TYPE;
expression THING;
identifier COUNT_ID;
constant COUNT_CONST;
@@(
- devm_kzalloc
+ devm_kcalloc
(HANDLE,
- sizeof(TYPE) * (COUNT_ID)
+ COUNT_ID, sizeof(TYPE)
, ...)
|
- devm_kzalloc
+ devm_kcalloc
(HANDLE,
- sizeof(TYPE) * COUNT_ID
+ COUNT_ID, sizeof(TYPE)
, ...)
|
- devm_kzalloc
+ devm_kcalloc
(HANDLE,
- sizeof(TYPE) * (COUNT_CONST)
+ COUNT_CONST, sizeof(TYPE)
, ...)
|
- devm_kzalloc
+ devm_kcalloc
(HANDLE,
- sizeof(TYPE) * COUNT_CONST
+ COUNT_CONST, sizeof(TYPE)
, ...)
|
- devm_kzalloc
+ devm_kcalloc
(HANDLE,
- sizeof(THING) * (COUNT_ID)
+ COUNT_ID, sizeof(THING)
, ...)
|
- devm_kzalloc
+ devm_kcalloc
(HANDLE,
- sizeof(THING) * COUNT_ID
+ COUNT_ID, sizeof(THING)
, ...)
|
- devm_kzalloc
+ devm_kcalloc
(HANDLE,
- sizeof(THING) * (COUNT_CONST)
+ COUNT_CONST, sizeof(THING)
, ...)
|
- devm_kzalloc
+ devm_kcalloc
(HANDLE,
- sizeof(THING) * COUNT_CONST
+ COUNT_CONST, sizeof(THING)
, ...)
)// 2-factor product, only identifiers.
@@
expression HANDLE;
identifier SIZE, COUNT;
@@- devm_kzalloc
+ devm_kcalloc
(HANDLE,
- SIZE * COUNT
+ COUNT, SIZE
, ...)// 3-factor product with 1 sizeof(type) or sizeof(expression), with
// redundant parens removed.
@@
expression HANDLE;
expression THING;
identifier STRIDE, COUNT;
type TYPE;
@@(
devm_kzalloc(HANDLE,
- sizeof(TYPE) * (COUNT) * (STRIDE)
+ array3_size(COUNT, STRIDE, sizeof(TYPE))
, ...)
|
devm_kzalloc(HANDLE,
- sizeof(TYPE) * (COUNT) * STRIDE
+ array3_size(COUNT, STRIDE, sizeof(TYPE))
, ...)
|
devm_kzalloc(HANDLE,
- sizeof(TYPE) * COUNT * (STRIDE)
+ array3_size(COUNT, STRIDE, sizeof(TYPE))
, ...)
|
devm_kzalloc(HANDLE,
- sizeof(TYPE) * COUNT * STRIDE
+ array3_size(COUNT, STRIDE, sizeof(TYPE))
, ...)
|
devm_kzalloc(HANDLE,
- sizeof(THING) * (COUNT) * (STRIDE)
+ array3_size(COUNT, STRIDE, sizeof(THING))
, ...)
|
devm_kzalloc(HANDLE,
- sizeof(THING) * (COUNT) * STRIDE
+ array3_size(COUNT, STRIDE, sizeof(THING))
, ...)
|
devm_kzalloc(HANDLE,
- sizeof(THING) * COUNT * (STRIDE)
+ array3_size(COUNT, STRIDE, sizeof(THING))
, ...)
|
devm_kzalloc(HANDLE,
- sizeof(THING) * COUNT * STRIDE
+ array3_size(COUNT, STRIDE, sizeof(THING))
, ...)
)// 3-factor product with 2 sizeof(variable), with redundant parens removed.
@@
expression HANDLE;
expression THING1, THING2;
identifier COUNT;
type TYPE1, TYPE2;
@@(
devm_kzalloc(HANDLE,
- sizeof(TYPE1) * sizeof(TYPE2) * COUNT
+ array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2))
, ...)
|
devm_kzalloc(HANDLE,
- sizeof(TYPE1) * sizeof(THING2) * (COUNT)
+ array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2))
, ...)
|
devm_kzalloc(HANDLE,
- sizeof(THING1) * sizeof(THING2) * COUNT
+ array3_size(COUNT, sizeof(THING1), sizeof(THING2))
, ...)
|
devm_kzalloc(HANDLE,
- sizeof(THING1) * sizeof(THING2) * (COUNT)
+ array3_size(COUNT, sizeof(THING1), sizeof(THING2))
, ...)
|
devm_kzalloc(HANDLE,
- sizeof(TYPE1) * sizeof(THING2) * COUNT
+ array3_size(COUNT, sizeof(TYPE1), sizeof(THING2))
, ...)
|
devm_kzalloc(HANDLE,
- sizeof(TYPE1) * sizeof(THING2) * (COUNT)
+ array3_size(COUNT, sizeof(TYPE1), sizeof(THING2))
, ...)
)// 3-factor product, only identifiers, with redundant parens removed.
@@
expression HANDLE;
identifier STRIDE, SIZE, COUNT;
@@(
devm_kzalloc(HANDLE,
- (COUNT) * STRIDE * SIZE
+ array3_size(COUNT, STRIDE, SIZE)
, ...)
|
devm_kzalloc(HANDLE,
- COUNT * (STRIDE) * SIZE
+ array3_size(COUNT, STRIDE, SIZE)
, ...)
|
devm_kzalloc(HANDLE,
- COUNT * STRIDE * (SIZE)
+ array3_size(COUNT, STRIDE, SIZE)
, ...)
|
devm_kzalloc(HANDLE,
- (COUNT) * (STRIDE) * SIZE
+ array3_size(COUNT, STRIDE, SIZE)
, ...)
|
devm_kzalloc(HANDLE,
- COUNT * (STRIDE) * (SIZE)
+ array3_size(COUNT, STRIDE, SIZE)
, ...)
|
devm_kzalloc(HANDLE,
- (COUNT) * STRIDE * (SIZE)
+ array3_size(COUNT, STRIDE, SIZE)
, ...)
|
devm_kzalloc(HANDLE,
- (COUNT) * (STRIDE) * (SIZE)
+ array3_size(COUNT, STRIDE, SIZE)
, ...)
|
devm_kzalloc(HANDLE,
- COUNT * STRIDE * SIZE
+ array3_size(COUNT, STRIDE, SIZE)
, ...)
)// Any remaining multi-factor products, first at least 3-factor products,
// when they're not all constants...
@@
expression HANDLE;
expression E1, E2, E3;
constant C1, C2, C3;
@@(
devm_kzalloc(HANDLE, C1 * C2 * C3, ...)
|
devm_kzalloc(HANDLE,
- (E1) * E2 * E3
+ array3_size(E1, E2, E3)
, ...)
|
devm_kzalloc(HANDLE,
- (E1) * (E2) * E3
+ array3_size(E1, E2, E3)
, ...)
|
devm_kzalloc(HANDLE,
- (E1) * (E2) * (E3)
+ array3_size(E1, E2, E3)
, ...)
|
devm_kzalloc(HANDLE,
- E1 * E2 * E3
+ array3_size(E1, E2, E3)
, ...)
)// And then all remaining 2 factors products when they're not all constants,
// keeping sizeof() as the second factor argument.
@@
expression HANDLE;
expression THING, E1, E2;
type TYPE;
constant C1, C2, C3;
@@(
devm_kzalloc(HANDLE, sizeof(THING) * C2, ...)
|
devm_kzalloc(HANDLE, sizeof(TYPE) * C2, ...)
|
devm_kzalloc(HANDLE, C1 * C2 * C3, ...)
|
devm_kzalloc(HANDLE, C1 * C2, ...)
|
- devm_kzalloc
+ devm_kcalloc
(HANDLE,
- sizeof(TYPE) * (E2)
+ E2, sizeof(TYPE)
, ...)
|
- devm_kzalloc
+ devm_kcalloc
(HANDLE,
- sizeof(TYPE) * E2
+ E2, sizeof(TYPE)
, ...)
|
- devm_kzalloc
+ devm_kcalloc
(HANDLE,
- sizeof(THING) * (E2)
+ E2, sizeof(THING)
, ...)
|
- devm_kzalloc
+ devm_kcalloc
(HANDLE,
- sizeof(THING) * E2
+ E2, sizeof(THING)
, ...)
|
- devm_kzalloc
+ devm_kcalloc
(HANDLE,
- (E1) * E2
+ E1, E2
, ...)
|
- devm_kzalloc
+ devm_kcalloc
(HANDLE,
- (E1) * (E2)
+ E1, E2
, ...)
|
- devm_kzalloc
+ devm_kcalloc
(HANDLE,
- E1 * E2
+ E1, E2
, ...)
)Signed-off-by: Kees Cook
22 Nov, 2016
1 commit
-
Fix the register access shift argument calculation introduced with
commit a59ce6584d56 ("leds: leds-mc13783: Add MC34708 LED support")
and re-enable access to the "keypad" led for MC13892 MFC devices.Signed-off-by: Alexander Kurz
Signed-off-by: Jacek Anaszewski
04 Jan, 2016
1 commit
-
Now the core implements the work queue, remove it from the drivers,
and switch to using brightness_set_blocking op.Signed-off-by: Andrew Lunn
Signed-off-by: Jacek Anaszewski
15 Jan, 2015
1 commit
-
of_find_node_by_name() calls of_node_put() on its "from" parameter.
To counter this, mc13xxx_led_probe_dt() calls of_node_get() first.Use of_get_child_by_name() instead to get rid of the refcount hack.
Signed-off-by: Geert Uytterhoeven
Cc: linux-leds@vger.kernel.org
Signed-off-by: Bryan Wu
20 Oct, 2014
1 commit
-
A platform_driver does not need to set an owner, it will be populated by the
driver core.Signed-off-by: Wolfram Sang
28 Feb, 2014
6 commits
-
None of these files are actually using any __init type directives
and hence don't need to include . Most are just a
left over from __devinit and __cpuinit removal, or simply due to
code getting copied from one driver to the next.Cc: Bryan Wu
Cc: Richard Purdie
Cc: linux-leds@vger.kernel.org
Signed-off-by: Paul Gortmaker
Signed-off-by: Bryan Wu -
This patch adds devicetree support for the MC13XXX LED driver.
(cooloney@gmail.com: remove unneeded semicolon)
Signed-off-by: Alexander Shiyan
Signed-off-by: Bryan Wu -
LED core switches each LED to OFF-state on exit, so there is no need
for resetting registers.Signed-off-by: Alexander Shiyan
Signed-off-by: Bryan Wu -
Instead of using maximum value of 255 and shift it to appropriate
LED duty cycle, this patch introduce a helper to use proper maximum
value for each LED.Signed-off-by: Alexander Shiyan
Signed-off-by: Bryan Wu -
Signed-off-by: Bryan Wu
-
This patch adds support for two LEDs on MC34708 PMIC.
Signed-off-by: Alexander Shiyan
Signed-off-by: Bryan Wu
28 Jan, 2014
2 commits
-
LED registers are used only in this driver, so no additional
locking is needed. Read-Modify-Write cycle in workqueue is already
protected by regmap.Signed-off-by: Alexander Shiyan
Signed-off-by: Bryan Wu -
LED platform data are overwhelmed by excessive field "max_cur"
which just replicates few bits of "led_control" field.
This patch removes this field and adds a definition for the
current settings in the header.Signed-off-by: Alexander Shiyan
Signed-off-by: Bryan Wu
02 Jul, 2013
1 commit
-
drivers/leds/leds-mc13783.c: In function 'mc13xxx_led_probe':
drivers/leds/leds-mc13783.c:195:2: warning: 'ret' may be used uninitialized in this function [-Wmaybe-uninitialized]Signed-off-by: Alexander Shiyan
Signed-off-by: Bryan Wu
21 Jun, 2013
3 commits
-
Signed-off-by: Alexander Shiyan
Tested-by: Philippe Retornaz
Signed-off-by: Bryan Wu -
This patch rewrite driver code to be ready to add support for
MC13892 LEDs and probe from devicetree.(cooloney@gmail.com: fix one coding style issue when apply this patch)
Signed-off-by: Alexander Shiyan
Tested-by: Philippe Retornaz
Signed-off-by: Bryan Wu -
The driver core clears the driver data to NULL after device_release
or on probe failure, since commit 0998d0631001288a5974afc0b2a5f568bcdecb4d
(device-core: Ensure drvdata = NULL when no driver is bound).
Thus, it is not needed to manually clear the device driver data to NULL.Signed-off-by: Jingoo Han
Signed-off-by: Bryan Wu
29 Nov, 2012
3 commits
-
CONFIG_HOTPLUG is going away as an option so __devexit is no
longer needed.Signed-off-by: Bill Pemberton
Cc: Richard Purdie
Cc: Jan-Simon Moeller
Acked-by: Bryan Wu
Signed-off-by: Greg Kroah-Hartman -
CONFIG_HOTPLUG is going away as an option so __devinit is no longer
needed.Signed-off-by: Bill Pemberton
Cc: Richard Purdie
Cc: Jan-Simon Moeller
Acked-by: Bryan Wu
Signed-off-by: Greg Kroah-Hartman -
CONFIG_HOTPLUG is going away as an option so __devexit_p is no longer
needed.Signed-off-by: Bill Pemberton
Cc: Richard Purdie
Cc: Jan-Simon Moeller
Acked-by: Bryan Wu
Signed-off-by: Greg Kroah-Hartman
24 Jul, 2012
2 commits
-
Cc: Philippe Retornaz
Signed-off-by: Bryan Wu -
the platform_set_drvdata (pdev, NULL) to be set at the remove of the
driver, as we have set the platform data to led at probe.Signed-off-by: Devendra Naga
Signed-off-by: Bryan Wu
30 May, 2012
1 commit
-
The advantage of kcalloc is that will prevent integer overflows which
could result from the multiplication of number of elements and size and it
is also a bit nicer to read.The semantic patch that makes this change is available
in https://lkml.org/lkml/2011/11/25/107Signed-off-by: Thomas Meyer
Cc: Bryan Wu
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
11 Jan, 2012
2 commits
-
The LED id begins from 0. Thus the maximum number of leds should be
MC13783_LED_MAX + 1.Signed-off-by: Axel Lin
Acked-by: Philippe Retornaz
Cc: Richard Purdie
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Factor out some boilerplate code for platform driver registration into
module_platform_driver.Signed-off-by: Axel Lin
Acked-by: Haojian Zhuang [led-88pm860x.c]
Acked-by: Mark Brown
Cc: Richard Purdie
Cc: Michael Hennerich
Cc: Mike Rapoport
Cc: Guennadi Liakhovetski
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
24 Oct, 2011
2 commits
-
Signed-off-by: Samuel Ortiz
-
mc13xxx is the more general API and most of the mc13783_... functions
are going to die.Signed-off-by: David Jander
Signed-off-by: Uwe Kleine-König
Signed-off-by: Samuel Ortiz
27 May, 2011
1 commit
-
With the addition of a platform device mfd_cell pointer, MFD drivers
can go back to passing platform data back to their sub drivers.
This allows for an mfd_cell->mfd_data removal and thus keep the
sub drivers MFD agnostic. This is mostly needed for non MFD aware
sub drivers.Cc: Mark Brown
Cc: Liam Girdwood
Acked-by: Uwe Kleine-König
Signed-off-by: Samuel Ortiz
26 Apr, 2011
1 commit
-
Fast-forwarded to current state of Linus' tree as there are patches to be
applied for files that didn't exist on the old branch.
10 Apr, 2011
1 commit
-
Signed-off-by: Justin P. Mattock
Signed-off-by: Jiri Kosina
23 Mar, 2011
1 commit
-
The cell's platform_data is now accessed with a helper function;
change clients to use that, and remove the now-unused data_size.Note that mfd-core no longer makes a copy of platform_data, but the
mc13xxx-core driver creates the pdata structures on the stack. In
order to get around that, the various ARM mach types that set the
pdata have been changed to hold the variable in static (global) memory.
Also note that __initdata references in aforementioned pdata structs
have been dropped.Signed-off-by: Andres Salomon
Signed-off-by: Samuel Ortiz
26 May, 2010
1 commit
-
This add basic led support for Freescale MC13783 PMIC.
Signed-off-by: Philippe Rétornaz
Signed-off-by: Richard Purdie