rtc: gamecube: Propagate address translation error
PATCH 1/5 rtc: gamecube: Propagate address translation error
If of_address_to_resource() fails, propagate its error code instead of returning -1 from gamecube_rtc_read_offset_from_sram().
--- drivers/rtc/rtc-gamecube.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/rtc/rtc-gamecube.c +1 -1
@@ -238,7 +238,7 @@ static int gamecube_rtc_read_offset_from_sram(struct priv *d)of_node_put (np);if (ret) {pr_err ("no io memory range found\n" ); -return -1 ; +return ret; } hw_srnprot =ioremap (res.start,resource_size (&res));
PATCH 2/5 rtc: gamecube: Add missing newline to SRAM bias debug message
Add a newline to the SRAM bias debug message to terminate it properly.
--- drivers/rtc/rtc-gamecube.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/rtc/rtc-gamecube.c +1 -1
@@ -339,7 +339,7 @@ static int gamecube_rtc_probe(struct platform_device *pdev) ret =gamecube_rtc_read_offset_from_sram (d);if (ret)return ret; -dev_dbg (dev,"SRAM bias: 0x%x" , d->rtc_bias); +dev_dbg (dev,"SRAM bias: 0x%x\n" , d->rtc_bias);dev_set_drvdata (dev, d);
[email protected]
AI reviewRe: [PATCH 2/5] rtc: gamecube: Add missing newline to SRAM bias debug message
Sashiko has reviewed this patch and found no issues.
Quoted 3 lines
Add a newline to the SRAM bias debug message to terminate it properly.
Signed-off-by Thorsten Blum <[email protected]>
Sashiko has reviewed this patch and found no issues.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2
PATCH 3/5 rtc: gamecube: Explain why fast_io is enabled
In reply to Thorsten BlumReplace the TODO with an explanation of why fast_io is enabled.
--- drivers/rtc/rtc-gamecube.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/rtc/rtc-gamecube.c +1 -1
@@ -152,7 +152,7 @@ static int exi_write(void *context, u32 reg, u32 data) }static const struct regmap_bus exi_bus = { -/* TODO: is that true? Not that it matters here, but still. */ +/* Transfers use MMIO and busy-wait for completion without sleeping. */ .fast_io = true, .reg_read = exi_read, .reg_write = exi_write,
[email protected]
AI reviewRe: [PATCH 3/5] rtc: gamecube: Explain why fast_io is enabled
Sashiko has reviewed this patch and found no issues.
Quoted 3 lines
Replace the TODO with an explanation of why
fast_iois enabled.Signed-off-by Thorsten Blum <[email protected]>
Sashiko has reviewed this patch and found no issues.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=3
PATCH 4/5 rtc: gamecube: Use unsigned int for control0
In reply to Thorsten Blumregmap_read() expects an unsigned int pointer for its output value. Declare control0 as unsigned int to match the expected type.
--- drivers/rtc/rtc-gamecube.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/rtc/rtc-gamecube.c +1 -1
@@ -190,7 +190,7 @@ static int gamecube_rtc_ioctl(struct device *dev, unsigned int cmd, unsigned lon {struct priv *d =dev_get_drvdata (dev);int value; -int control0; +unsigned int control0;int ret;switch (cmd) {
[email protected]
AI reviewRe: [PATCH 4/5] rtc: gamecube: Use unsigned int for control0
Sashiko has reviewed this patch and found no issues.
Quoted 4 lines
regmap_read()expects an unsigned int pointer for its output value. Declare control0 as unsigned int to match the expected type.Signed-off-by Thorsten Blum <[email protected]>
Sashiko has reviewed this patch and found no issues.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=4
PATCH 5/5 rtc: gamecube: Use register definitions
In reply to Thorsten BlumUse the register definitions to replace the hard-coded addresses to improve readability. Add RTC_SRAM_LAST for the SRAM range end.
--- drivers/rtc/rtc-gamecube.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-)
drivers/rtc/rtc-gamecube.c +11 -10
@@ -73,6 +73,7 @@#define RTC_COUNTER 0x200000#define RTC_SRAM 0x200001#define RTC_SRAM_BIAS 0x200004 +#define RTC_SRAM_LAST 0x200010#define RTC_SNAPSHOT 0x204000#define RTC_ONTMR 0x210000#define RTC_OFFTMR 0x210001
@@ -283,11 +284,11 @@ static int gamecube_rtc_read_offset_from_sram(struct priv *d) }static const struct regmap_range rtc_rd_ranges[] = { -regmap_reg_range (0x200000 ,0x200010 ), -regmap_reg_range (0x204000 ,0x204000 ), -regmap_reg_range (0x210000 ,0x210001 ), -regmap_reg_range (0x210004 ,0x210007 ), -regmap_reg_range (0x21000c ,0x21000d ), +regmap_reg_range (RTC_COUNTER ,RTC_SRAM_LAST ), +regmap_reg_range (RTC_SNAPSHOT ,RTC_SNAPSHOT ), +regmap_reg_range (RTC_ONTMR ,RTC_OFFTMR ), +regmap_reg_range (RTC_TEST0 ,RTC_TEST3 ), +regmap_reg_range (RTC_CONTROL0 ,RTC_CONTROL1 ), };static const struct regmap_access_table rtc_rd_regs = {
@@ -296,10 +297,10 @@ static const struct regmap_access_table rtc_rd_regs = { };static const struct regmap_range rtc_wr_ranges[] = { -regmap_reg_range (0x200000 ,0x200010 ), -regmap_reg_range (0x204000 ,0x204000 ), -regmap_reg_range (0x210000 ,0x210001 ), -regmap_reg_range (0x21000d ,0x21000d ), +regmap_reg_range (RTC_COUNTER ,RTC_SRAM_LAST ), +regmap_reg_range (RTC_SNAPSHOT ,RTC_SNAPSHOT ), +regmap_reg_range (RTC_ONTMR ,RTC_OFFTMR ), +regmap_reg_range (RTC_CONTROL1 ,RTC_CONTROL1 ), };static const struct regmap_access_table rtc_wr_regs = {
@@ -312,7 +313,7 @@ static const struct regmap_config gamecube_rtc_regmap_config = { .val_bits = 32, .rd_table = &rtc_rd_regs, .wr_table = &rtc_wr_regs, - .max_register = 0x21000d, + .max_register = RTC_CONTROL1, .name = "gamecube-rtc", };
[email protected]
AI reviewRe: [PATCH 5/5] rtc: gamecube: Use register definitions
Sashiko has reviewed this patch and found no issues.
Quoted 4 lines
Use the register definitions to replace the hard-coded addresses to improve readability. Add
RTC_SRAM_LASTfor the SRAM range end.Signed-off-by Thorsten Blum <[email protected]>
Sashiko has reviewed this patch and found no issues.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=5
[email protected]
AI reviewSashiko has reviewed this patch and found no issues.
Quoted 5 lines
If
of_address_to_resource()fails, propagate its error code instead of returning -1 fromgamecube_rtc_read_offset_from_sram().Fixes 86559400b3ef ("rtc: gamecube: Add a RTC driver for the GameCube, Wii and Wii U")Signed-off-by Thorsten Blum <[email protected]>
Sashiko has reviewed this patch and found no issues.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1