aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ipack
diff options
context:
space:
mode:
authorFederico Vaga <federico.vaga@cern.ch>2014-09-02 11:31:40 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-09-24 02:13:13 -0400
commit36c53b3cc3fac6952af68f43609b15ae050c9318 (patch)
treebf265c1d5992290869d0d4caee7f7f398467dfa2 /drivers/ipack
parent78f22bc29e6e367f272a7fc700baa4d4263d376a (diff)
ipack: save carrier owner to allow device to get it
There was not any kind of protection against carrier driver removal. In this way, device driver can 'get' the carrier driver when it is using it. Signed-off-by: Federico Vaga <federico.vaga@cern.ch> Acked-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/ipack')
-rw-r--r--drivers/ipack/carriers/tpci200.c3
-rw-r--r--drivers/ipack/ipack.c4
2 files changed, 5 insertions, 2 deletions
diff --git a/drivers/ipack/carriers/tpci200.c b/drivers/ipack/carriers/tpci200.c
index de5e32151a1e..9b23843dcad4 100644
--- a/drivers/ipack/carriers/tpci200.c
+++ b/drivers/ipack/carriers/tpci200.c
@@ -572,7 +572,8 @@ static int tpci200_pci_probe(struct pci_dev *pdev,
572 /* Register the carrier in the industry pack bus driver */ 572 /* Register the carrier in the industry pack bus driver */
573 tpci200->info->ipack_bus = ipack_bus_register(&pdev->dev, 573 tpci200->info->ipack_bus = ipack_bus_register(&pdev->dev,
574 TPCI200_NB_SLOT, 574 TPCI200_NB_SLOT,
575 &tpci200_bus_ops); 575 &tpci200_bus_ops,
576 THIS_MODULE);
576 if (!tpci200->info->ipack_bus) { 577 if (!tpci200->info->ipack_bus) {
577 dev_err(&pdev->dev, 578 dev_err(&pdev->dev,
578 "error registering the carrier on ipack driver\n"); 579 "error registering the carrier on ipack driver\n");
diff --git a/drivers/ipack/ipack.c b/drivers/ipack/ipack.c
index d0016ba469ed..c0e7b624ce54 100644
--- a/drivers/ipack/ipack.c
+++ b/drivers/ipack/ipack.c
@@ -206,7 +206,8 @@ static struct bus_type ipack_bus_type = {
206}; 206};
207 207
208struct ipack_bus_device *ipack_bus_register(struct device *parent, int slots, 208struct ipack_bus_device *ipack_bus_register(struct device *parent, int slots,
209 const struct ipack_bus_ops *ops) 209 const struct ipack_bus_ops *ops,
210 struct module *owner)
210{ 211{
211 int bus_nr; 212 int bus_nr;
212 struct ipack_bus_device *bus; 213 struct ipack_bus_device *bus;
@@ -225,6 +226,7 @@ struct ipack_bus_device *ipack_bus_register(struct device *parent, int slots,
225 bus->parent = parent; 226 bus->parent = parent;
226 bus->slots = slots; 227 bus->slots = slots;
227 bus->ops = ops; 228 bus->ops = ops;
229 bus->owner = owner;
228 return bus; 230 return bus;
229} 231}
230EXPORT_SYMBOL_GPL(ipack_bus_register); 232EXPORT_SYMBOL_GPL(ipack_bus_register);