11 Aug, 2018
1 commit
-
This is a GPIO driver so include only .
Cc: Richard Röjfors
Signed-off-by: Linus Walleij
22 Feb, 2018
2 commits
-
Replace the specification of a data structure by a pointer dereference
as the parameter for the operator "sizeof" to make the corresponding size
determination a bit safer according to the Linux coding style convention.This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring
Signed-off-by: Linus Walleij -
Omit an extra message for a memory allocation failure in this function.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring
Signed-off-by: Linus Walleij
11 May, 2016
1 commit
-
The Kconfig currently controlling compilation of this code is:
drivers/gpio/Kconfig:config GPIO_TIMBERDALE
drivers/gpio/Kconfig: bool "Support for timberdale GPIO IP"...meaning that it currently is not being built as a module by anyone.
Lets remove the modular code that is essentially orphaned, so that
when reading the driver there is no doubt it is builtin-only.We explicitly disallow a driver unbind, since that doesn't have a
sensible use case anyway, and it allows us to drop the ".remove"
code for non-modular drivers.Since module_platform_driver() uses the same init level priority as
builtin_platform_driver() the init ordering remains unchanged with
this commit.We also delete the MODULE_LICENSE tag etc. since all that information
was (or is now) contained at the top of the file in the comments.Cc: Linus Walleij
Cc: Alexandre Courbot
Cc: linux-gpio@vger.kernel.org
Signed-off-by: Paul Gortmaker
Signed-off-by: Linus Walleij
08 Mar, 2016
1 commit
-
Replace calls to devm_request_mem_region and devm_ioremap with a
direct call to devm_ioremap_resource instead and modify error
handling.Move the call to platform_get_resource adjacent to the call to
devm_ioremap_resource to make the connection between them more
clear.A simplified version of the Coccinelle semantic patch that is used to
make this change is as follows:
//
@nm@
expression myname;
identifier i;
@@struct platform_driver i = { .driver = { .name = myname } };
@@
expression dev,res,size,e1,e;
expression nm.myname;
@@-if (!devm_request_mem_region(dev, res->start, size,
- \(res->name\|dev_name(dev)\|myname\)))
{
- ...
- return ...;
-}
... when != res->start = e1
e =
-devm_ioremap(dev,res->start,size);
+devm_ioremap_resource(dev,res);if
-(e == NULL)
+(IS_ERR(e))
{
...
-return ...;
+return PTR_ERR(e);
}
//Further, updated error handling by hand as devm_ioremap_resource
gives appropriate error messages, so remove unnecessary error
messages.Signed-off-by: Amitoj Kaur Chawla
Signed-off-by: Linus Walleij
23 Feb, 2016
1 commit
-
Use devm_gpiochip_add_data() for GPIO registration.
Signed-off-by: Laxman Dewangan
05 Jan, 2016
1 commit
-
This makes the driver use the data pointer added to the gpio_chip
to store a pointer to the state container instead of relying on
container_of().Signed-off-by: Linus Walleij
19 Nov, 2015
1 commit
-
The name .dev in a struct is normally reserved for a struct device
that is let us say a superclass to the thing described by the struct.
struct gpio_chip stands out by confusingly using a struct device *dev
to point to the parent device (such as a platform_device) that
represents the hardware. As we want to give gpio_chip:s real devices,
this is not working. We need to rename this member to parent.This was done by two coccinelle scripts, I guess it is possible to
combine them into one, but I don't know such stuff. They look like
this:@@
struct gpio_chip *var;
@@
-var->dev
+var->parentand:
@@
struct gpio_chip var;
@@
-var.dev
+var.parentand:
@@
struct bgpio_chip *var;
@@
-var->gc.dev
+var->gc.parentPlus a few instances of bgpio that I couldn't figure out how
to teach Coccinelle to rewrite.This patch hits all over the place, but I *strongly* prefer this
solution to any piecemal approaches that just exercise patch
mechanics all over the place. It mainly hits drivers/gpio and
drivers/pinctrl which is my own backyard anyway.Cc: Haavard Skinnemoen
Cc: Rafał Miłecki
Cc: Richard Purdie
Cc: Mauro Carvalho Chehab
Cc: Alek Du
Cc: Jaroslav Kysela
Cc: Takashi Iwai
Acked-by: Dmitry Torokhov
Acked-by: Greg Kroah-Hartman
Acked-by: Lee Jones
Acked-by: Jiri Kosina
Acked-by: Hans-Christian Egtvedt
Acked-by: Jacek Anaszewski
Signed-off-by: Linus Walleij
16 Sep, 2015
1 commit
-
Most interrupt flow handlers do not use the irq argument. Those few
which use it can retrieve the irq number from the irq descriptor.Remove the argument.
Search and replace was done with coccinelle and some extra helper
scripts around it. Thanks to Julia for her help!Signed-off-by: Thomas Gleixner
Cc: Julia Lawall
Cc: Jiang Liu
28 Jul, 2015
1 commit
-
set_irq_flags is ARM specific with custom flags which have genirq
equivalents. Convert drivers to use the genirq interfaces directly, so we
can kill off set_irq_flags. The translation of flags is as follows:IRQF_VALID -> !IRQ_NOREQUEST
IRQF_PROBE -> !IRQ_NOPROBE
IRQF_NOAUTOEN -> IRQ_NOAUTOENFor IRQs managed by an irqdomain, the irqdomain core code handles clearing
and setting IRQ_NOREQUEST already, so there is no need to do this in
.map() functions and we can simply remove the set_irq_flags calls. Some
users also modify IRQ_NOPROBE and this has been maintained although it
is not clear that is really needed as most platforms don't use probing.
There appears to be a great deal of blind copy and paste of this code.Signed-off-by: Rob Herring
Cc: Michael Hennerich
Acked-by: Linus Walleij
Cc: Alexandre Courbot
Cc: Ray Jui
Cc: Stephen Warren
Cc: Thierry Reding
Cc: linux-gpio@vger.kernel.org
Cc: bcm-kernel-feedback-list@broadcom.com
Cc: linux-tegra@vger.kernel.org
Signed-off-by: Linus Walleij
14 Jul, 2015
2 commits
-
Use irq_desc_get_xxx() to avoid redundant lookup of irq_desc while we
already have a pointer to corresponding irq_desc.Preparatory patch for the removal of the 'irq' argument from irq flow
handlers.Signed-off-by: Jiang Liu
Acked-by: Linus Walleij
Cc: Alexandre Courbot
Signed-off-by: Thomas Gleixner -
Chained irq handlers usually set up handler data as well. We now have
a function to set both under irq_desc->lock. Replace the two calls
with one.Search and conversion was done with coccinelle:
Reported-by: Russell King
Signed-off-by: Thomas Gleixner
Cc: Julia Lawall
Cc: Linus Walleij
Cc: Alexandre Courbot
Cc: linux-gpio@vger.kernel.org
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
22 Jul, 2014
1 commit
-
Signed-off-by: abdoulaye berthe
Signed-off-by: Linus Walleij
16 May, 2014
1 commit
-
This eases memory allocation and provides appropriate logging.
Signed-off-by: abdoulaye berthe
Signed-off-by: Linus Walleij
04 Dec, 2013
1 commit
-
This switches the two members of struct gpio_chip that were
defined as unsigned foo:1 to bool, because that is indeed what
they are. Switch all users in the gpio and pinctrl subsystems
to assign these values with true/false instead of 0/1. The
users outside these subsystems will survive since true/false
is 1/0, atleast we set some kind of more strict typing example.Signed-off-by: Linus Walleij
03 Dec, 2013
1 commit
-
Switch all users of irq_set_chip_and_handler_name() to simply
use irq_set_chip_and_handler(), all just provide a boilerplate
name like "demux" or "mux" - a fact which is anyway obvious
from the hwirq number from the irqdomain now present in e.g.
/proc/interrupts.Cc: Mathias Nyman
Cc: Dan Carpenter
Acked-by: David Cohen
Acked-by: Mika Westerberg
Tested-by: Mika Westerberg
Signed-off-by: Linus Walleij
16 Aug, 2013
1 commit
-
Use the wrapper function for retrieving the platform data instead of
accessing dev->platform_data directly.Signed-off-by: Jingoo Han
Signed-off-by: Linus Walleij
31 May, 2013
1 commit
-
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: Linus Walleij
27 Mar, 2013
1 commit
-
Fix :
gpio/gpio-timberdale.c:171: ERROR: else should follow close brace '}'Signed-off-by: Laurent Navet
Signed-off-by: Linus Walleij
29 Nov, 2012
2 commits
-
CONFIG_HOTPLUG is going away as an option so __devexit is no
longer needed.Signed-off-by: Bill Pemberton
Cc: Grant Likely
Acked-by: Linus Walleij
Cc: Peter Tyser
Acked-by: Mark Brown
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: Grant Likely
Cc: Peter Tyser
Cc: Santosh Shilimkar
Cc: Kevin Hilman
Acked-by: Linus Walleij
Acked-by: Mark Brown
Signed-off-by: Greg Kroah-Hartman
16 Oct, 2012
1 commit
-
->last_ier is an unsigned long but the high bits can't be used int the
original code because the shift wraps.Cc: stable@kernel.org
Signed-off-by: Dan Carpenter
Signed-off-by: Linus Walleij
02 Jan, 2012
1 commit
-
Where appropriate factor out some boilerplate code for platform device
registration into module_platform_driver. Drivers that don't use the
standard module_init initcall haven't been converted.Signed-off-by: Mark Brown
Signed-off-by: Grant Likely
07 Jun, 2011
1 commit
-
Sort the gpio makefile and enforce the naming convention gpio-*.c for
gpio drivers.v2: cleaned up filenames in Kconfig and comment blocks
v3: fixup use of BASIC_MMIO to GENERIC_GPIO for mxcSigned-off-by: Grant Likely