Skip to contentSkip to conversation

pwm: raspberrypi-poe: Fix mailbox message initialization

PATCH In review Nicolas Saenz Julienne 3 participants 3 messages Apr 9, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pwm: raspberrypi-poe: Fix mailbox message initialization

For testing purposes this driver might be built on big-endian architectures. So make sure we take that into account when populating structures that are to be passed to RPi4's mailbox.

Fixes 79caa362eab6 ("pwm: Add Raspberry Pi Firmware based PWM bus")

---

@arndb: This was just meged into the arm-soc tree some days ago. Should I prepare a second PR once it's been reviewed?

 drivers/pwm/pwm-raspberrypi-poe.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pwm/pwm-raspberrypi-poe.c +1 -1
index 043fc32e8be8..78423e66f4fc 100644
@@ -66,7 +66,7 @@ static int raspberrypi_pwm_get_property(struct rpi_firmware *firmware,
 					u32 reg, u32 *val)
 {
 	struct raspberrypi_pwm_prop msg = {
-		.reg = reg
+		.reg = cpu_to_le32(reg),
 	};
 	int ret;
 
Signature · 1 line
2.30.2
Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Nicolas Saenz Julienne

For testing purposes this driver might be built on big-endian architectures. So make sure we take that into account when populating structures that are to be passed to RPi4's mailbox.

Fixes 79caa362eab6 ("pwm: Add Raspberry Pi Firmware based PWM bus")
Quoted 7 lines

---

@arndb: This was just meged into the arm-soc tree some days ago. Should I prepare a second PR once it's been reviewed?

 drivers/pwm/pwm-raspberrypi-poe.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
#2 lore raw
In reply to Nicolas Saenz Julienne
Quoted 5 lines · Nicolas Saenz Julienne

For testing purposes this driver might be built on big-endian architectures. So make sure we take that into account when populating structures that are to be passed to RPi4's mailbox.

Quoted 7 lines
Fixes 79caa362eab6 ("pwm: Add Raspberry Pi Firmware based PWM bus")

---

@arndb: This was just meged into the arm-soc tree some days ago. Should I prepare a second PR once it's been reviewed?

Yes, that would be good. If you have no other driver patches that I should pick up, just forward the patch (with the Ack) to [email protected] and I can just apply it.

Arnd