feature.c (9cdf083f981b8d37b3212400a359368661385099) | feature.c (e71c5c38ed578b4fff3139cc5c76fb5d0544f80c) |
---|---|
1/* 2 * Copyright (C) 1996-2001 Paul Mackerras (paulus@cs.anu.edu.au) 3 * Ben. Herrenschmidt (benh@kernel.crashing.org) 4 * 5 * This program is free software; you can redistribute it and/or 6 * modify it under the terms of the GNU General Public License 7 * as published by the Free Software Foundation; either version 8 * 2 of the License, or (at your option) any later version. --- 796 unchanged lines hidden (view full) --- 805} 806 807static long 808core99_ata100_enable(struct device_node *node, long value) 809{ 810 unsigned long flags; 811 struct pci_dev *pdev = NULL; 812 u8 pbus, pid; | 1/* 2 * Copyright (C) 1996-2001 Paul Mackerras (paulus@cs.anu.edu.au) 3 * Ben. Herrenschmidt (benh@kernel.crashing.org) 4 * 5 * This program is free software; you can redistribute it and/or 6 * modify it under the terms of the GNU General Public License 7 * as published by the Free Software Foundation; either version 8 * 2 of the License, or (at your option) any later version. --- 796 unchanged lines hidden (view full) --- 805} 806 807static long 808core99_ata100_enable(struct device_node *node, long value) 809{ 810 unsigned long flags; 811 struct pci_dev *pdev = NULL; 812 u8 pbus, pid; |
813 int rc; |
|
813 814 if (uninorth_rev < 0x24) 815 return -ENODEV; 816 817 LOCK(flags); 818 if (value) 819 UN_BIS(UNI_N_CLOCK_CNTL, UNI_N_CLOCK_CNTL_ATA100); 820 else 821 UN_BIC(UNI_N_CLOCK_CNTL, UNI_N_CLOCK_CNTL_ATA100); 822 (void)UN_IN(UNI_N_CLOCK_CNTL); 823 UNLOCK(flags); 824 udelay(20); 825 826 if (value) { 827 if (pci_device_from_OF_node(node, &pbus, &pid) == 0) 828 pdev = pci_find_slot(pbus, pid); 829 if (pdev == NULL) 830 return 0; | 814 815 if (uninorth_rev < 0x24) 816 return -ENODEV; 817 818 LOCK(flags); 819 if (value) 820 UN_BIS(UNI_N_CLOCK_CNTL, UNI_N_CLOCK_CNTL_ATA100); 821 else 822 UN_BIC(UNI_N_CLOCK_CNTL, UNI_N_CLOCK_CNTL_ATA100); 823 (void)UN_IN(UNI_N_CLOCK_CNTL); 824 UNLOCK(flags); 825 udelay(20); 826 827 if (value) { 828 if (pci_device_from_OF_node(node, &pbus, &pid) == 0) 829 pdev = pci_find_slot(pbus, pid); 830 if (pdev == NULL) 831 return 0; |
831 pci_enable_device(pdev); | 832 rc = pci_enable_device(pdev); 833 if (rc) 834 return rc; |
832 pci_set_master(pdev); 833 } 834 return 0; 835} 836 837static long 838core99_ide_enable(struct device_node *node, long param, long value) 839{ --- 2172 unchanged lines hidden --- | 835 pci_set_master(pdev); 836 } 837 return 0; 838} 839 840static long 841core99_ide_enable(struct device_node *node, long param, long value) 842{ --- 2172 unchanged lines hidden --- |