Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 105688
b: refs/heads/master
c: 1d76d9d
h: refs/heads/master
v: v3
  • Loading branch information
Bartlomiej Zolnierkiewicz committed Jul 24, 2008
1 parent ba914de commit 45d9247
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 74811f355f4f69a187fa74892dcf2a684b84ce99
refs/heads/master: 1d76d9dc448d5a6fc7b49ba06c634aa6927bcc3d
28 changes: 13 additions & 15 deletions trunk/drivers/ide/pci/it821x.c
Original file line number Diff line number Diff line change
Expand Up @@ -534,8 +534,9 @@ static struct ide_dma_ops it821x_pass_through_dma_ops = {
static void __devinit init_hwif_it821x(ide_hwif_t *hwif)
{
struct pci_dev *dev = to_pci_dev(hwif->dev);
struct it821x_dev **itdevs = (struct it821x_dev **)pci_get_drvdata(dev);
struct it821x_dev *idev = itdevs[hwif->channel];
struct ide_host *host = pci_get_drvdata(dev);
struct it821x_dev *itdevs = host->host_priv;
struct it821x_dev *idev = itdevs + hwif->channel;
u8 conf;

ide_set_hwifdata(hwif, idev);
Expand Down Expand Up @@ -648,23 +649,20 @@ static const struct ide_port_info it821x_chipsets[] __devinitdata = {

static int __devinit it821x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
{
struct it821x_dev *itdevs[2] = { NULL, NULL} , *itdev;
unsigned int i;

for (i = 0; i < 2; i++) {
itdev = kzalloc(sizeof(*itdev), GFP_KERNEL);
if (itdev == NULL) {
kfree(itdevs[0]);
printk(KERN_ERR "it821x: out of memory\n");
return -ENOMEM;
}
struct it821x_dev *itdevs;
int rc;

itdevs[i] = itdev;
itdevs = kzalloc(2 * sizeof(*itdevs), GFP_KERNEL);
if (itdevs == NULL) {
printk(KERN_ERR "it821x: out of memory\n");
return -ENOMEM;
}

pci_set_drvdata(dev, itdevs);
rc = ide_pci_init_one(dev, &it821x_chipsets[id->driver_data], itdevs);
if (rc)
kfree(itdevs);

return ide_pci_init_one(dev, &it821x_chipsets[id->driver_data], NULL);
return rc;
}

static const struct pci_device_id it821x_pci_tbl[] = {
Expand Down

0 comments on commit 45d9247

Please sign in to comment.