diff mbox series

oxnas: fix qc_prep return in sata driver after kernel 5.4.69

Message ID 20201009144430.45966-1-freifunk@adrianschmutzler.de
State Accepted
Delegated to: Daniel Golle
Headers show
Series oxnas: fix qc_prep return in sata driver after kernel 5.4.69 | expand

Commit Message

Adrian Schmutzler Oct. 9, 2020, 2:44 p.m. UTC
This fixes a regression after a kernel change in 5.4.69 [1] that
led to build failure on oxnas/ox820:

  drivers/ata/sata_oxnas.c:2238:13: error: initialization of
  'enum ata_completion_errors (*)(struct ata_queued_cmd *)'
  from incompatible pointer type
  'void (*)(struct ata_queued_cmd *)' [-Werror=incompatible-pointer-types]
    .qc_prep = sata_oxnas_qc_prep,
  drivers/ata/sata_oxnas.c:2238:13: note:
  (near initialization for 'sata_oxnas_ops.qc_prep')

Our local driver is changed the same way as prototyped in the
kernel patch, i.e. return type is changed and AC_ERR_OK return
value is added.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=e11c83520cd04b813cd1748ee2a8f2c620e5f7e3

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
 target/linux/oxnas/files/drivers/ata/sata_oxnas.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff mbox series


diff --git a/target/linux/oxnas/files/drivers/ata/sata_oxnas.c b/target/linux/oxnas/files/drivers/ata/sata_oxnas.c
index 64231a8c70..b55995ccad 100644
--- a/target/linux/oxnas/files/drivers/ata/sata_oxnas.c
+++ b/target/linux/oxnas/files/drivers/ata/sata_oxnas.c
@@ -1802,7 +1802,7 @@  static inline void sata_oxnas_reset_ucode(struct ata_host *ah, int force,
  * Prepare as much as possible for a command without involving anything that is
  * shared between ports.
-static void sata_oxnas_qc_prep(struct ata_queued_cmd *qc)
+static enum ata_completion_errors sata_oxnas_qc_prep(struct ata_queued_cmd *qc)
 	struct sata_oxnas_port_priv *pd;
 	int port_no = qc->ap->port_no;
@@ -1848,6 +1848,8 @@  static void sata_oxnas_qc_prep(struct ata_queued_cmd *qc)
 		/* tell it to wait */
 		iowrite32(SGDMA_CONTROL_NOGO, pd->sgdma_base + SGDMA_CONTROL);
+	return AC_ERR_OK;
 static int sata_oxnas_port_start(struct ata_port *ap)