Skip to content

Commit

Permalink
rtc: s3c: Do not remove const from rodata memory
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
  • Loading branch information
Krzysztof Kozlowski authored and Alexandre Belloni committed Jun 24, 2017
1 parent 21df6fe commit 6b72086
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/rtc/rtc-s3c.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 6b72086

Please sign in to comment.