7217-dpaa2-evb-Add-object-version-check.patch 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. From 213c59501bbd6da8c56e95f90f8a8c6af2682002 Mon Sep 17 00:00:00 2001
  2. From: Razvan Stefanescu <razvan.stefanescu@freescale.com>
  3. Date: Thu, 18 Feb 2016 10:54:40 +0200
  4. Subject: [PATCH 217/226] dpaa2-evb: Add object version check
  5. Abort probing if DPDMUX object version is smaller than required.
  6. Signed-off-by: Razvan Stefanescu <razvan.stefanescu@freescale.com>
  7. ---
  8. drivers/staging/fsl-dpaa2/evb/evb.c | 15 +++++++++++++++
  9. 1 file changed, 15 insertions(+)
  10. --- a/drivers/staging/fsl-dpaa2/evb/evb.c
  11. +++ b/drivers/staging/fsl-dpaa2/evb/evb.c
  12. @@ -44,6 +44,10 @@
  13. #include "dpdmux.h"
  14. #include "dpdmux-cmd.h"
  15. +/* Minimal supported DPDMUX version */
  16. +#define DPDMUX_MIN_VER_MAJOR 5
  17. +#define DPDMUX_MIN_VER_MINOR 0
  18. +
  19. /* IRQ index */
  20. #define DPDMUX_MAX_IRQ_NUM 2
  21. @@ -1004,6 +1008,17 @@ static int evb_init(struct fsl_mc_device
  22. goto err_close;
  23. }
  24. + /* Minimum supported DPDMUX version check */
  25. + if (priv->attr.version.major < DPDMUX_MIN_VER_MAJOR ||
  26. + (priv->attr.version.major == DPDMUX_MIN_VER_MAJOR &&
  27. + priv->attr.version.minor < DPDMUX_MIN_VER_MINOR)) {
  28. + dev_err(dev, "DPDMUX version %d.%d not supported. Use %d.%d or greater.\n",
  29. + priv->attr.version.major, priv->attr.version.minor,
  30. + DPDMUX_MIN_VER_MAJOR, DPDMUX_MIN_VER_MAJOR);
  31. + err = -ENOTSUPP;
  32. + goto err_close;
  33. + }
  34. +
  35. err = dpdmux_reset(priv->mc_io, 0, priv->mux_handle);
  36. if (unlikely(err)) {
  37. dev_err(dev, "dpdmux_reset err %d\n", err);