Skip to content

Commit

Permalink
pata_isapnp: Don't use invalid I/O ports
Browse files Browse the repository at this point in the history
The test for 2nd I/O port validity is broken (reversed): On devices
with no control port, the driver attempts to use invalid port 0,
resulting in logs full of bad_io_access errors.  On devices with
control port, the driver does not use it.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: Tejun Heo <tj@kernel.org>
  • Loading branch information
Ondrej Zary authored and Tejun Heo committed Oct 7, 2013
1 parent 272b98c commit fc0012e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/ata/pata_isapnp.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ static int isapnp_init_one(struct pnp_dev *idev, const struct pnp_device_id *dev

ap->ioaddr.cmd_addr = cmd_addr;

if (pnp_port_valid(idev, 1) == 0) {
if (pnp_port_valid(idev, 1)) {
ctl_addr = devm_ioport_map(&idev->dev,
pnp_port_start(idev, 1), 1);
ap->ioaddr.altstatus_addr = ctl_addr;
Expand Down

0 comments on commit fc0012e

Please sign in to comment.