diff options
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/mmc/mmcsd.c | 8 | ||||
| -rw-r--r-- | sys/dev/nvme/nvme_ns.c | 14 | ||||
| -rw-r--r-- | sys/dev/thunderbolt/tb_pcib.c | 14 | 
3 files changed, 24 insertions, 12 deletions
diff --git a/sys/dev/mmc/mmcsd.c b/sys/dev/mmc/mmcsd.c index 5b9cb93c7b31..f2965048b285 100644 --- a/sys/dev/mmc/mmcsd.c +++ b/sys/dev/mmc/mmcsd.c @@ -1422,7 +1422,7 @@ mmcsd_task(void *arg)  	struct mmcsd_softc *sc;  	struct bio *bp;  	device_t dev, mmcbus; -	int bio_error, err, sz; +	int abio_error, err, sz;  	part = arg;  	sc = part->sc; @@ -1430,7 +1430,7 @@ mmcsd_task(void *arg)  	mmcbus = sc->mmcbus;  	while (1) { -		bio_error = 0; +		abio_error = 0;  		MMCSD_DISK_LOCK(part);  		do {  			if (part->running == 0) @@ -1475,11 +1475,11 @@ mmcsd_task(void *arg)  		} else if (bp->bio_cmd == BIO_DELETE)  			block = mmcsd_delete(part, bp);  		else -			bio_error = EOPNOTSUPP; +			abio_error = EOPNOTSUPP;  release:  		MMCBUS_RELEASE_BUS(mmcbus, dev);  		if (block < end) { -			bp->bio_error = (bio_error == 0) ? EIO : bio_error; +			bp->bio_error = (abio_error == 0) ? EIO : abio_error;  			bp->bio_resid = (end - block) * sz;  			bp->bio_flags |= BIO_ERROR;  		} else diff --git a/sys/dev/nvme/nvme_ns.c b/sys/dev/nvme/nvme_ns.c index f4a588373c98..17684cc14ba2 100644 --- a/sys/dev/nvme/nvme_ns.c +++ b/sys/dev/nvme/nvme_ns.c @@ -45,7 +45,7 @@  #include "nvme_private.h"  #include "nvme_linux.h" -static void		nvme_bio_child_inbed(struct bio *parent, int bio_error); +static void		nvme_bio_child_inbed(struct bio *parent, int abio_error);  static void		nvme_bio_child_done(void *arg,  					    const struct nvme_completion *cpl);  static uint32_t		nvme_get_num_segments(uint64_t addr, uint64_t size, @@ -275,14 +275,14 @@ nvme_ns_bio_done(void *arg, const struct nvme_completion *status)  }  static void -nvme_bio_child_inbed(struct bio *parent, int bio_error) +nvme_bio_child_inbed(struct bio *parent, int abio_error)  {  	struct nvme_completion	parent_cpl;  	int			children, inbed; -	if (bio_error != 0) { +	if (abio_error != 0) {  		parent->bio_flags |= BIO_ERROR; -		parent->bio_error = bio_error; +		parent->bio_error = abio_error;  	}  	/* @@ -309,12 +309,12 @@ nvme_bio_child_done(void *arg, const struct nvme_completion *cpl)  {  	struct bio		*child = arg;  	struct bio		*parent; -	int			bio_error; +	int			abio_error;  	parent = child->bio_parent;  	g_destroy_bio(child); -	bio_error = nvme_completion_is_error(cpl) ? EIO : 0; -	nvme_bio_child_inbed(parent, bio_error); +	abio_error = nvme_completion_is_error(cpl) ? EIO : 0; +	nvme_bio_child_inbed(parent, abio_error);  }  static uint32_t diff --git a/sys/dev/thunderbolt/tb_pcib.c b/sys/dev/thunderbolt/tb_pcib.c index 00738984ad1c..bc4fc1ce00ec 100644 --- a/sys/dev/thunderbolt/tb_pcib.c +++ b/sys/dev/thunderbolt/tb_pcib.c @@ -557,8 +557,20 @@ static int  tb_pci_probe(device_t dev)  {  	struct tb_pcib_ident *n; +	device_t parent; +	devclass_t dc; -	if ((n = tb_pcib_find_ident(device_get_parent(dev))) != NULL) { +	/* +	 * This driver is only valid if the parent device is a PCI-PCI +	 * bridge.  To determine that, check if the grandparent is a +	 * PCI bus. +	 */ +	parent = device_get_parent(dev); +	dc = device_get_devclass(device_get_parent(parent)); +	if (strcmp(devclass_get_name(dc), "pci") != 0) +		return (ENXIO); + +	if ((n = tb_pcib_find_ident(parent)) != NULL) {  		switch (n->flags & TB_GEN_MASK) {  		case TB_GEN_TB1:  			device_set_desc(dev, "Thunderbolt 1 Link");  | 
