Age | Commit message (Collapse) | Author | Files | Lines |
|
convertfromdays and convert2days never return errors, stop handling non
existent errors.
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexandre Belloni <[email protected]>
|
|
Let the core handle offsetting and windowing the RTC range.
This rtc has hours, minutes, seconds and 16bit days. As the driver has the
RTC epoch set to year 2000, this means that the end of the range is 2^16
days minus one second later. This is Sun Jun 6 23:59:59 UTC 2179. This
is better than the currently set year 2099.
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexandre Belloni <[email protected]>
|
|
The code handling invalid alarms meaning the alarm is in the next 24 hours
is not necessary since commit f8245c26886c ("rtc: remove "RTC_ALM_SET mode"
bugs") which actually predates this driver. Since then, .set_alarm is never
called with an invalid alarm and this handling is not necessary in the
driver.
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexandre Belloni <[email protected]>
|
|
This allows further improvement of the driver. Also remove the unnecessary
error string as the core will already display error messages.
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexandre Belloni <[email protected]>
|
|
Use devm_platform_ioremap_resource() to simplify the code a bit.
This is detected by coccinelle.
Signed-off-by: YueHaibing <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Link: https://lore.kernel.org/r/[email protected]
Link: https://lore.kernel.org/r/[email protected]
Link: https://lore.kernel.org/r/[email protected]
Link: https://lore.kernel.org/r/[email protected]
Link: https://lore.kernel.org/r/[email protected]
Link: https://lore.kernel.org/r/[email protected]
Link: https://lore.kernel.org/r/[email protected]
Link: https://lore.kernel.org/r/[email protected]
Link: https://lore.kernel.org/r/[email protected]
Link: https://lore.kernel.org/r/[email protected]
Link: https://lore.kernel.org/r/[email protected]
Link: https://lore.kernel.org/r/[email protected]
Link: https://lore.kernel.org/r/[email protected]
Link: https://lore.kernel.org/r/[email protected]
Link: https://lore.kernel.org/r/[email protected]
Link: https://lore.kernel.org/r/[email protected]
Link: https://lore.kernel.org/r/[email protected]
Link: https://lore.kernel.org/r/[email protected]
Link: https://lore.kernel.org/r/[email protected]
Link: https://lore.kernel.org/r/[email protected]
Link: https://lore.kernel.org/r/[email protected]
Link: https://lore.kernel.org/r/[email protected]
Link: https://lore.kernel.org/r/[email protected]
Link: https://lore.kernel.org/r/[email protected]
Link: https://lore.kernel.org/r/[email protected]
Link: https://lore.kernel.org/r/[email protected]
Link: https://lore.kernel.org/r/[email protected]
Link: https://lore.kernel.org/r/[email protected]
Link: https://lore.kernel.org/r/[email protected]
Link: https://lore.kernel.org/r/[email protected]
Link: https://lore.kernel.org/r/[email protected]
Link: https://lore.kernel.org/r/[email protected]
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexandre Belloni <[email protected]>
|
|
We don't need dev_err() messages when platform_get_irq() fails now that
platform_get_irq() prints an error message itself when something goes
wrong. Let's remove these prints with a simple semantic patch.
// <smpl>
@@
expression ret;
struct platform_device *E;
@@
ret =
(
platform_get_irq(E, ...)
|
platform_get_irq_byname(E, ...)
);
if ( \( ret < 0 \| ret <= 0 \) )
{
(
-if (ret != -EPROBE_DEFER)
-{ ...
-dev_err(...);
-... }
|
...
-dev_err(...);
)
...
}
// </smpl>
While we're here, remove braces on if statements that only have one
statement (manually).
Cc: Alessandro Zummo <[email protected]>
Cc: Alexandre Belloni <[email protected]>
Cc: [email protected]
Cc: Greg Kroah-Hartman <[email protected]>
Signed-off-by: Stephen Boyd <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexandre Belloni <[email protected]>
|
|
Based on 1 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 as published by
the free software foundation either version 2 of the license or at
your option any later version this program is distributed in the
hope that it will be useful but without any warranty without even
the implied warranty of merchantability or fitness for a particular
purpose see the gnu general public license for more details you
should have received a copy of the gnu general public license along
with this program if not write to the free software foundation inc
59 temple place suite 330 boston ma 02111 1307 usa
extracted by the scancode license scanner the SPDX license identifier
GPL-2.0-or-later
has been chosen to replace the boilerplate/reference in 1334 file(s).
Signed-off-by: Thomas Gleixner <[email protected]>
Reviewed-by: Allison Randal <[email protected]>
Reviewed-by: Richard Fontana <[email protected]>
Cc: [email protected]
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Check for rtc_class_ops structures that are only passed to
devm_rtc_device_register, rtc_device_register,
platform_device_register_data, all of which declare the corresponding
parameter as const. Declare rtc_class_ops structures that have these
properties as const.
The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)
// <smpl>
@r disable optional_qualifier@
identifier i;
position p;
@@
static struct rtc_class_ops i@p = { ... };
@ok@
identifier r.i;
expression e1,e2,e3,e4;
position p;
@@
(
devm_rtc_device_register(e1,e2,&i@p,e3)
|
rtc_device_register(e1,e2,&i@p,e3)
|
platform_device_register_data(e1,e2,e3,&i@p,e4)
)
@bad@
position p != {r.p,ok.p};
identifier r.i;
@@
i@p
@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
struct rtc_class_ops i = { ... };
// </smpl>
Signed-off-by: Julia Lawall <[email protected]>
Acked-by: Baruch Siach <[email protected]>
Acked-by: Hans Ulli Kroll <[email protected]>
Acked-by: Linus Walleij <[email protected]>
Acked-by: Thierry Reding <[email protected]>
Signed-off-by: Alexandre Belloni <[email protected]>
|
|
Since all time members of the alarm data is initialized to -1 the drivers
are responsible to set the tm_sec member to 0.
Fixes: d68778b80dd7 ("rtc: initialize output parameter for read alarm to "uninitialized"")
Signed-off-by: Uwe Kleine-König <[email protected]>
Signed-off-by: Alexandre Belloni <[email protected]>
|
|
The davinci rtc driver uses the module_platform_driver_probe()
helper to call the probe function and mark it as __init, but
it also puts a reference into its davinci_rtc_driver function.
This will crash if we ever get a deferred probe and the probe
function is called again after the init section has been removed.
kbuild warns about this:
WARNING: vmlinux.o(.data+0x1aa2b4): Section mismatch in reference from the variable davinci_rtc_driver to the function .init.text:davinci_rtc_probe()
The variable davinci_rtc_driver references
the function __init davinci_rtc_probe()
This patch removes the .probe callback from the platform driver,
which avoids those problems.
Signed-off-by: Arnd Bergmann <[email protected]>
Signed-off-by: Alexandre Belloni <[email protected]>
|
|
A platform_driver does not need to set an owner, it will be populated by the
driver core.
Signed-off-by: Wolfram Sang <[email protected]>
|
|
Use devm_ioremap_resource() in order to make the code simpler, and
remove redundant return value check of platform_get_resource() because
the value is checked by devm_ioremap_resource().
Signed-off-by: Jingoo Han <[email protected]>
Cc: Kevin Hilman <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
|
|
The site-specific OOM messages are unnecessary, because they duplicate
the MM subsystem generic OOM message.
Signed-off-by: Jingoo Han <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
|
|
The driver core clears the driver data to NULL after device_release or
on probe failure, since commit 0998d063100 ("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 <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
|
|
Silences the following warning:
WARNING: please, no space before tabs
Signed-off-by: Sachin Kamat <[email protected]>
Cc: Jingoo Han <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
|
|
devm_rtc_device_register() is device managed and makes cleanup
paths simpler.
Signed-off-by: Jingoo Han <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
|
|
Use module_platform_driver_probe() macro which makes the code smaller and
simpler.
Signed-off-by: Jingoo Han <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
|
|
When platform_driver_probe() is used, bind/unbind via sysfs is disabled.
Thus, __init/__exit annotations can be added to probe()/remove().
Signed-off-by: Jingoo Han <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
|
|
Use devm_*() functions to make cleanup paths more simple.
Signed-off-by: Jingoo Han <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
|
|
CONFIG_HOTPLUG is going away as an option. As a result, the __dev*
markings need to be removed.
This change removes the use of __devinit, __devexit_p, __devinitdata,
__devinitconst, and __devexit from these drivers.
Based on patches originally written by Bill Pemberton, but redone by me
in order to handle some of the coding style issues better, by hand.
Cc: Bill Pemberton <[email protected]>
Cc: Alessandro Zummo <[email protected]>
Cc: Srinidhi Kasagar <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Mike Frysinger <[email protected]>
Cc: Wan ZongShun <[email protected]>
Cc: Guan Xuetao <[email protected]>
Cc: Mark Brown <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Use devm_kzalloc() and remove the error path free and the unload free as
devm functions take care of freeing resources.
Signed-off-by: Devendra Naga <[email protected]>
Cc: Alessandro Zummo <[email protected]>
Cc: Miguel Aguilar <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
|
|
rtc_device_register() returns a pointer containing error code in case
of error. Use that in the error return.
Signed-off-by: Devendra Naga <[email protected]>
Cc: Alessandro Zummo <[email protected]>
Cc: Miguel Aguilar <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
|
|
Since commit e58aa3d2d0cc ("genirq: run irq handlers with interrupts
disabled") we run all interrupt handlers with interrupts disabled and we
even check and yell when an interrupt handler returns with interrupts
enabled - see commit b738a50a2026 ("genirq: warn when handler enables
interrupts").
So now this flag is a NOOP and can be removed.
Signed-off-by: Yong Zhang <[email protected]>
Acked-by: Linus Walleij <[email protected]>
Acked-by: Wan ZongShun <[email protected]>
Cc: Alessandro Zummo <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Ingo Molnar <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
|
|
Commit f44f7f96a20 ("RTC: Initialize kernel state from RTC") uncovered
an issue in a number of RTC drivers, where the drivers call
rtc_device_register before initializing the device or platform drvdata.
This frequently results in null pointer dereferences when the
rtc_device_register immediately makes use of the rtc device, calling
rtc_read_alarm.
The solution is to ensure the drvdata is initialized prior to registering
the rtc device.
CC: Alessandro Zummo <[email protected]>
CC: Thomas Gleixner <[email protected]>
CC: [email protected]
Signed-off-by: Wolfram Sang <[email protected]>
[fixed up commit log -jstultz]
Signed-off-by: John Stultz <[email protected]>
|
|
With the generic RTC rework, the UIE mode irqs are handled
in the generic layer, and only hardware specific ioctls
get passed down to the rtc driver layer.
So this patch removes the UIE mode ioctl handling in the rtc
driver layer, which never get used.
CC: Thomas Gleixner <[email protected]>
CC: Alessandro Zummo <[email protected]>
CC: Marcelo Roberto Jimenez <[email protected]>
CC: [email protected]
Signed-off-by: John Stultz <[email protected]>
|
|
With the generic rtc code now emulating PIE mode irqs via an
hrtimer, no one calls the rtc_class_ops->irq_set_freq call.
This patch removes the hook and deletes the driver functions
if no one else calls them.
CC: Thomas Gleixner <[email protected]>
CC: Alessandro Zummo <[email protected]>
CC: Marcelo Roberto Jimenez <[email protected]>
CC: [email protected]
Signed-off-by: John Stultz <[email protected]>
|
|
With PIE mode interrupts now emulated in generic code via an hrtimer,
no one calls rtc_class_ops->irq_set_state(), so this patch removes it
along with driver implementations.
CC: Thomas Gleixner <[email protected]>
CC: Alessandro Zummo <[email protected]>
CC: Marcelo Roberto Jimenez <[email protected]>
CC: [email protected]
Signed-off-by: John Stultz <[email protected]>
|
|
Implicit slab.h inclusion via percpu.h is about to go away. Make sure
gfp.h or slab.h is included as necessary.
Signed-off-by: Tejun Heo <[email protected]>
Cc: Stephen Rothwell <[email protected]>
Cc: Kevin Hilman <[email protected]>
Signed-off-by: Stephen Rothwell <[email protected]>
|
|
This driver features:
* Alarm support.
* Periodic interrupt by using a timer include into the RTC module.
* The update interrupt is not supported by this RTC module.
This driver was tested on a DM365 EVM by using the rtc-test application
from the Documentation/rtc.txt.
Signed-off-by: Miguel Aguilar <[email protected]>
Signed-off-by: Kevin Hilman <[email protected]>
Acked-by: Alessandro Zummo <[email protected]>
|