diff mbox

[2/3] PCI: imx6: prevent driver unbind

Message ID 1406137217-11294-3-git-send-email-l.stach@pengutronix.de (mailing list archive)
State New, archived
Delegated to: Bjorn Helgaas
Headers show

Commit Message

Lucas Stach July 23, 2014, 5:40 p.m. UTC
The current code is not prepared for the driver to be
bound/unbound arbitrarily.

Prevent possible user visible issues by disabling the
bind sysfs attributes.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
---
 drivers/pci/host/pci-imx6.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Jingoo Han July 24, 2014, 3:52 a.m. UTC | #1
On Thursday, July 24, 2014 2:40 AM, Lucas Stach wrote:
> 
> The current code is not prepared for the driver to be
> bound/unbound arbitrarily.
> 
> Prevent possible user visible issues by disabling the
> bind sysfs attributes.
> 
> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
> ---
>  drivers/pci/host/pci-imx6.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/pci/host/pci-imx6.c b/drivers/pci/host/pci-imx6.c
> index a568efaa331c..ceb1677884b2 100644
> --- a/drivers/pci/host/pci-imx6.c
> +++ b/drivers/pci/host/pci-imx6.c
> @@ -600,6 +600,7 @@ static struct platform_driver imx6_pcie_driver = {
>  		.name	= "imx6q-pcie",
>  		.owner	= THIS_MODULE,
>  		.of_match_table = imx6_pcie_of_match,
> +		.suppress_bind_attrs = true,

pci-imx6.c already uses platform_driver_probe().
In platform_driver_probe(),suppress_bind_attrs is set as true as below,

./drivers/base/platform.c

int __init_or_module platform_driver_probe(struct platform_driver *drv,
		int (*probe)(struct platform_device *))
{
	int retval, code;

	/*
	 * Prevent driver from requesting probe deferral to avoid further
	 * futile probe attempts.
	 */
	drv->prevent_deferred_probe = true;

	/* make sure driver won't have bind/unbind attributes */
	drv->driver.suppress_bind_attrs = true;

So, it looks duplicated.
Is there any reason to do it twice?

Best regards,
Jingoo Han

>  	},
>  };
> 
> --
> 2.0.1

--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/pci/host/pci-imx6.c b/drivers/pci/host/pci-imx6.c
index a568efaa331c..ceb1677884b2 100644
--- a/drivers/pci/host/pci-imx6.c
+++ b/drivers/pci/host/pci-imx6.c
@@ -600,6 +600,7 @@  static struct platform_driver imx6_pcie_driver = {
 		.name	= "imx6q-pcie",
 		.owner	= THIS_MODULE,
 		.of_match_table = imx6_pcie_of_match,
+		.suppress_bind_attrs = true,
 	},
 };