Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1668019
| From | Krzysztof Kozlowski <krzk@kernel.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 4/6] rtc: s3c: Do not remove const from rodata memory |
| Date | 2017-06-16 21:30 +0200 |
| Message-ID | <tT56q-4r7-17@gated-at.bofh.it> (permalink) |
| References | <tT56q-4r7-5@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
All instances of struct s3c_rtc_data are in fact static const thus
put in rodata so we should not drop the const while getting the pointer
to them.
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
drivers/rtc/rtc-s3c.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c
index bfc8660ff1e7..c666b95fb8d7 100644
--- a/drivers/rtc/rtc-s3c.c
+++ b/drivers/rtc/rtc-s3c.c
@@ -41,7 +41,7 @@ struct s3c_rtc {
struct clk *rtc_src_clk;
bool clk_disabled;
- struct s3c_rtc_data *data;
+ const struct s3c_rtc_data *data;
int irq_alarm;
int irq_tick;
@@ -437,12 +437,12 @@ static int s3c_rtc_remove(struct platform_device *pdev)
static const struct of_device_id s3c_rtc_dt_match[];
-static struct s3c_rtc_data *s3c_rtc_get_data(struct platform_device *pdev)
+static const struct s3c_rtc_data *s3c_rtc_get_data(struct platform_device *pdev)
{
const struct of_device_id *match;
match = of_match_node(s3c_rtc_dt_match, pdev->dev.of_node);
- return (struct s3c_rtc_data *)match->data;
+ return match->data;
}
static int s3c_rtc_probe(struct platform_device *pdev)
--
2.9.3
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 1/6] rtc: s3c: Jump to central exit point on getting src clock error Krzysztof Kozlowski <krzk@kernel.org> - 2017-06-16 21:30 +0200 [PATCH 6/6] rtc: s3c: Handle clock enable failures Krzysztof Kozlowski <krzk@kernel.org> - 2017-06-16 21:30 +0200 [PATCH 3/6] rtc: s3c: Drop unneeded cast to void pointer Krzysztof Kozlowski <krzk@kernel.org> - 2017-06-16 21:30 +0200 [PATCH 4/6] rtc: s3c: Do not remove const from rodata memory Krzysztof Kozlowski <krzk@kernel.org> - 2017-06-16 21:30 +0200 [PATCH 2/6] rtc: s3c: Minor white-space cleanups Krzysztof Kozlowski <krzk@kernel.org> - 2017-06-16 21:30 +0200 [PATCH 5/6] rtc: s3c: Handle clock prepare failures in probe Krzysztof Kozlowski <krzk@kernel.org> - 2017-06-16 21:30 +0200
csiph-web