<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/rtc/class.c, branch v4.14</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v4.14</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.14'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2017-07-07T11:14:14Z</updated>
<entry>
<title>rtc: add generic nvmem support</title>
<updated>2017-07-07T11:14:14Z</updated>
<author>
<name>Alexandre Belloni</name>
<email>alexandre.belloni@free-electrons.com</email>
</author>
<published>2017-07-06T09:42:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=697e5a47aa12cdab6f2a8b284cc923cdf704eafc'/>
<id>urn:sha1:697e5a47aa12cdab6f2a8b284cc923cdf704eafc</id>
<content type='text'>
Many RTCs have an on board non volatile storage. It can be battery backed
RAM or an EEPROM. Use the nvmem subsystem to export it to both userspace
and in-kernel consumers.

This stays compatible with the previous (non documented) ABI that was using
/sys/class/rtc/rtcx/device/nvram to export that memory. But will warn about
the deprecation.

Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
</content>
</entry>
<entry>
<title>rtc: introduce new registration method</title>
<updated>2017-07-07T11:14:10Z</updated>
<author>
<name>Alexandre Belloni</name>
<email>alexandre.belloni@free-electrons.com</email>
</author>
<published>2017-07-06T09:42:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=3068a254d5519cd5116f61297462da6d1aa84c20'/>
<id>urn:sha1:3068a254d5519cd5116f61297462da6d1aa84c20</id>
<content type='text'>
Introduce rtc_register_device() to register an already allocated and
initialized struct rtc_device. It automatically sets up the owner and the
two steps allocation/registration will allow to remove race conditions in
the IRQ handling of some driver. It also allows to properly extend the core
without adding more arguments to rtc_device_register().

Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
</content>
</entry>
<entry>
<title>rtc: class separate id allocation from registration</title>
<updated>2017-07-07T11:14:08Z</updated>
<author>
<name>Alexandre Belloni</name>
<email>alexandre.belloni@free-electrons.com</email>
</author>
<published>2017-07-06T09:41:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b91336df8ac2f5d15a2132074ba596580526db1d'/>
<id>urn:sha1:b91336df8ac2f5d15a2132074ba596580526db1d</id>
<content type='text'>
Create rtc_device_get_id to allocate the id for an RTC.

Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
</content>
</entry>
<entry>
<title>rtc: class separate device allocation from registration</title>
<updated>2017-07-07T11:14:06Z</updated>
<author>
<name>Alexandre Belloni</name>
<email>alexandre.belloni@free-electrons.com</email>
</author>
<published>2017-07-06T09:41:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d1bec20facd6eae17cb2f39ebbf443c95c650490'/>
<id>urn:sha1:d1bec20facd6eae17cb2f39ebbf443c95c650490</id>
<content type='text'>
Create rtc_allocate_device to allocate memory for a struct rtc_device and
initialize it.

Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
</content>
</entry>
<entry>
<title>rtc: remove rtc_device.name</title>
<updated>2017-06-03T08:55:36Z</updated>
<author>
<name>Alexandre Belloni</name>
<email>alexandre.belloni@free-electrons.com</email>
</author>
<published>2017-06-02T12:15:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5c82a6ae0242416cfead597bb2b42aa3481a0ba7'/>
<id>urn:sha1:5c82a6ae0242416cfead597bb2b42aa3481a0ba7</id>
<content type='text'>
rtc-&gt;name is only used in messages were it is superfluous. Remove it
completely from the structure.

Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
</content>
</entry>
<entry>
<title>rtc: utilize new cdev_device_add helper function</title>
<updated>2017-03-21T05:44:33Z</updated>
<author>
<name>Logan Gunthorpe</name>
<email>logang@deltatee.com</email>
</author>
<published>2017-03-17T18:48:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d5ed9177f64fe95d9de79e6504d41612d9127e8a'/>
<id>urn:sha1:d5ed9177f64fe95d9de79e6504d41612d9127e8a</id>
<content type='text'>
Mostly straightforward, but we had to remove the rtc_dev_add/del_device
functions as they split up the cdev_add and the device_add.

Doing this also revealed that there was likely another subtle bug:
seeing cdev_add was done after device_register, the cdev probably
was not ready before device_add when the uevent occurs. This would
race with userspace, if it tried to use the device directly after
the uevent. This is fixed just by using the new helper function.

Another weird thing is this driver would, in some error cases, call
cdev_add() without calling cdev_init. This patchset corrects this
by avoiding calling cdev_add if the devt is not set.

Signed-off-by: Logan Gunthorpe &lt;logang@deltatee.com&gt;
Acked-by: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>rtc: make class.c explicitly non-modular</title>
<updated>2016-03-14T16:08:18Z</updated>
<author>
<name>Paul Gortmaker</name>
<email>paul.gortmaker@windriver.com</email>
</author>
<published>2016-02-14T20:04:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=270a3bd6bdc2140708f88337c833e74ddafdcf61'/>
<id>urn:sha1:270a3bd6bdc2140708f88337c833e74ddafdcf61</id>
<content type='text'>
The Makefile/Kconfig currently controlling compilation of this code is:

obj-$(CONFIG_RTC_CLASS)         += rtc-core.o
rtc-core-y                      := class.o interface.o

drivers/rtc/Kconfig:menuconfig RTC_CLASS
drivers/rtc/Kconfig:    bool "Real Time Clock"

...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 code there is no doubt it is builtin-only.

We don't replace module.h with init.h since the file does need
to know what a struct module is.

We also delete the MODULE_LICENSE tag etc. since all that information
is already contained at the top of the file in the comments.

Signed-off-by: Paul Gortmaker &lt;paul.gortmaker@windriver.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
</content>
</entry>
<entry>
<title>rtc: switch to using is_visible() to control sysfs attributes</title>
<updated>2015-09-05T11:19:07Z</updated>
<author>
<name>Dmitry Torokhov</name>
<email>dmitry.torokhov@gmail.com</email>
</author>
<published>2015-07-23T23:01:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=3ee2c40b7ac2bf121aaa1176d8ac25b6a26e3a94'/>
<id>urn:sha1:3ee2c40b7ac2bf121aaa1176d8ac25b6a26e3a94</id>
<content type='text'>
Instead of creating wakealarm attribute manually, after the device has been
registered, let's rely on facilities provided by the attribute groups to
control which attributes are visible and which are not. This allows to
create all needed attributes at once, at the same time that we register RTC
class device.

Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
Reviewed-by: Krzysztof Kozlowski &lt;k.kozlowski@samsung.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
</content>
</entry>
<entry>
<title>rtc: class: remove unnecessary device_get() in rtc_device_unregister</title>
<updated>2015-09-05T11:19:07Z</updated>
<author>
<name>Dmitry Torokhov</name>
<email>dmitry.torokhov@gmail.com</email>
</author>
<published>2015-07-20T23:02:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c3b399a4b6703a04ef6eb3efe35ff12163e409e0'/>
<id>urn:sha1:c3b399a4b6703a04ef6eb3efe35ff12163e409e0</id>
<content type='text'>
Technically the address of rtc-&gt;dev can never be NULL, so get_device()
can never fail. Also caller of rtc_device_unregister() supposed to be
the owner of the device and thus have a valid reference. Therefore
call to get_device() is not needed here.

Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
Reviewed-by: Krzysztof Kozlowski &lt;k.kozlowski@samsung.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
</content>
</entry>
<entry>
<title>rtc: class: fix double free in rtc_register_device() error path</title>
<updated>2015-09-05T11:19:07Z</updated>
<author>
<name>Dmitry Torokhov</name>
<email>dmitry.torokhov@gmail.com</email>
</author>
<published>2015-07-20T23:02:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=6706664d92ea841913d5fcfd06c290fbe6d33bd2'/>
<id>urn:sha1:6706664d92ea841913d5fcfd06c290fbe6d33bd2</id>
<content type='text'>
Commit 59cca865f21e ("drivers/rtc/class.c: fix device_register() error
handling") correctly noted that naked kfree() should not be used after
failed device_register() call, however, while it added the needed
put_device() it forgot to remove the original kfree() causing double-free.

Cc: Vasiliy Kulikov &lt;segooon@gmail.com&gt;
Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
Reviewed-by: Krzysztof Kozlowski &lt;k.kozlowski@samsung.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
</content>
</entry>
</feed>
