diff mbox

[v3,9/9] vfio: Add AMBA driver_override support

Message ID 20170620154846.17487.67316.stgit@gimli.home (mailing list archive)
State New, archived
Headers show

Commit Message

Alex Williamson June 20, 2017, 3:48 p.m. UTC
AMBA also supports driver_override, but amba_bustype was not exported
to be able to identify an amba device.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
---
 drivers/vfio/vfio.c |    6 ++++++
 1 file changed, 6 insertions(+)

Comments

Eric Auger June 26, 2017, 7:30 a.m. UTC | #1
Hi Alex,

On 20/06/2017 17:48, Alex Williamson wrote:
> AMBA also supports driver_override, but amba_bustype was not exported
> to be able to identify an amba device.
> 
> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>

Eric
> ---
>  drivers/vfio/vfio.c |    6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/vfio/vfio.c b/drivers/vfio/vfio.c
> index 20e57fecf652..36f0fcfded0b 100644
> --- a/drivers/vfio/vfio.c
> +++ b/drivers/vfio/vfio.c
> @@ -36,6 +36,7 @@
>  #include <linux/uuid.h>
>  #include <linux/vfio.h>
>  #include <linux/wait.h>
> +#include <linux/amba/bus.h>
>  
>  #define DRIVER_VERSION	"0.3"
>  #define DRIVER_AUTHOR	"Alex Williamson <alex.williamson@redhat.com>"
> @@ -743,6 +744,11 @@ static char **vfio_find_driver_override(struct device *dev)
>  	} else if (dev->bus == &platform_bus_type) {
>  		struct platform_device *pdev = to_platform_device(dev);
>  		return &pdev->driver_override;
> +#ifdef CONFIG_ARM_AMBA
> +	} else if (dev->bus == &amba_bustype) {
> +		struct amba_device *adev = to_amba_device(dev);
> +		return &adev->driver_override;
> +#endif
>  	}
>  
>  	return NULL;
>
diff mbox

Patch

diff --git a/drivers/vfio/vfio.c b/drivers/vfio/vfio.c
index 20e57fecf652..36f0fcfded0b 100644
--- a/drivers/vfio/vfio.c
+++ b/drivers/vfio/vfio.c
@@ -36,6 +36,7 @@ 
 #include <linux/uuid.h>
 #include <linux/vfio.h>
 #include <linux/wait.h>
+#include <linux/amba/bus.h>
 
 #define DRIVER_VERSION	"0.3"
 #define DRIVER_AUTHOR	"Alex Williamson <alex.williamson@redhat.com>"
@@ -743,6 +744,11 @@  static char **vfio_find_driver_override(struct device *dev)
 	} else if (dev->bus == &platform_bus_type) {
 		struct platform_device *pdev = to_platform_device(dev);
 		return &pdev->driver_override;
+#ifdef CONFIG_ARM_AMBA
+	} else if (dev->bus == &amba_bustype) {
+		struct amba_device *adev = to_amba_device(dev);
+		return &adev->driver_override;
+#endif
 	}
 
 	return NULL;