forked from luck/tmp_suning_uos_patched
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/ide
Pull IDE updates from David Miller: 1) Fix mem region name in tx4949ide driver, from Christophe JAILLET. 2) Make drive->dn read only, it should not be changeable by users. From Dan Carpenter. 3) Several cast fixups from Krzysztof Kozlowski. There is also going to be a removal of a now unused IDE driver, but that will come via the MIPS tree. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/ide: ide: make drive->dn read only ide: serverworks: potential overflow in svwks_set_pio_mode() cmd64x: potential buffer overflow in cmd64x_program_timings() ide: remove unneeded header include path to drivers/ide ide: qd65xx: Fix cast to pointer from integer of different size ide: ht6560b: Fix cast to pointer from integer of different size ide: remove set but not used variable 'hwif' ide: remove unnecessary touch_softlockup_watchdog ide: tx4939ide: Fix the name used in a 'devm_request_mem_region()' call ide: Use dev_get_drvdata where possible
This commit is contained in:
commit
5e237e8c77
|
@ -3,8 +3,6 @@
|
|||
# link order is important here
|
||||
#
|
||||
|
||||
ccflags-y := -Idrivers/ide
|
||||
|
||||
ide-core-y += ide.o ide-ioctls.o ide-io.o ide-iops.o ide-lib.o ide-probe.o \
|
||||
ide-taskfile.o ide-pm.o ide-park.o ide-sysfs.o ide-devsets.o \
|
||||
ide-io-std.o ide-eh.o
|
||||
|
|
|
@ -66,6 +66,9 @@ static void cmd64x_program_timings(ide_drive_t *drive, u8 mode)
|
|||
struct ide_timing t;
|
||||
u8 arttim = 0;
|
||||
|
||||
if (drive->dn >= ARRAY_SIZE(drwtim_regs))
|
||||
return;
|
||||
|
||||
ide_timing_compute(drive, mode, &t, T, 0);
|
||||
|
||||
/*
|
||||
|
|
|
@ -310,7 +310,7 @@ static void __init ht6560b_init_dev(ide_drive_t *drive)
|
|||
{
|
||||
ide_hwif_t *hwif = drive->hwif;
|
||||
/* Setting default configurations for drives. */
|
||||
int t = (HT_CONFIG_DEFAULT << 8) | HT_TIMING_DEFAULT;
|
||||
unsigned long t = (HT_CONFIG_DEFAULT << 8) | HT_TIMING_DEFAULT;
|
||||
|
||||
if (hwif->channel)
|
||||
t |= (HT_SECONDARY_IF << 8);
|
||||
|
|
|
@ -530,7 +530,6 @@ int ide_wait_not_busy(ide_hwif_t *hwif, unsigned long timeout)
|
|||
*/
|
||||
if (stat == 0xff)
|
||||
return -ENODEV;
|
||||
touch_softlockup_watchdog();
|
||||
touch_nmi_watchdog();
|
||||
}
|
||||
return -EBUSY;
|
||||
|
|
|
@ -206,7 +206,7 @@ static int set_xfer_rate (ide_drive_t *drive, int arg)
|
|||
ide_devset_rw(current_speed, xfer_rate);
|
||||
ide_devset_rw_field(init_speed, init_speed);
|
||||
ide_devset_rw_flag(nice1, IDE_DFLAG_NICE1);
|
||||
ide_devset_rw_field(number, dn);
|
||||
ide_devset_ro_field(number, dn);
|
||||
|
||||
static const struct ide_proc_devset ide_generic_settings[] = {
|
||||
IDE_PROC_DEVSET(current_speed, 0, 70),
|
||||
|
|
|
@ -1019,7 +1019,6 @@ static int pmac_ide_setup_device(pmac_ide_hwif_t *pmif, struct ide_hw *hw)
|
|||
struct device_node *np = pmif->node;
|
||||
const int *bidp;
|
||||
struct ide_host *host;
|
||||
ide_hwif_t *hwif;
|
||||
struct ide_hw *hws[] = { hw };
|
||||
struct ide_port_info d = pmac_port_info;
|
||||
int rc;
|
||||
|
@ -1075,7 +1074,7 @@ static int pmac_ide_setup_device(pmac_ide_hwif_t *pmif, struct ide_hw *hw)
|
|||
rc = -ENOMEM;
|
||||
goto bail;
|
||||
}
|
||||
hwif = pmif->hwif = host->ports[0];
|
||||
pmif->hwif = host->ports[0];
|
||||
|
||||
if (on_media_bay(pmif)) {
|
||||
/* Fixup bus ID for media bay */
|
||||
|
|
|
@ -299,7 +299,7 @@ static void __init qd6500_init_dev(ide_drive_t *drive)
|
|||
static void __init qd6580_init_dev(ide_drive_t *drive)
|
||||
{
|
||||
ide_hwif_t *hwif = drive->hwif;
|
||||
u16 t1, t2;
|
||||
unsigned long t1, t2;
|
||||
u8 base = (hwif->config_data & 0xff00) >> 8;
|
||||
u8 config = QD_CONFIG(hwif);
|
||||
|
||||
|
|
|
@ -115,6 +115,9 @@ static void svwks_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive)
|
|||
struct pci_dev *dev = to_pci_dev(hwif->dev);
|
||||
const u8 pio = drive->pio_mode - XFER_PIO_0;
|
||||
|
||||
if (drive->dn >= ARRAY_SIZE(drive_pci))
|
||||
return;
|
||||
|
||||
pci_write_config_byte(dev, drive_pci[drive->dn], pio_modes[pio]);
|
||||
|
||||
if (svwks_csb_check(dev)) {
|
||||
|
@ -141,6 +144,9 @@ static void svwks_set_dma_mode(ide_hwif_t *hwif, ide_drive_t *drive)
|
|||
|
||||
u8 ultra_enable = 0, ultra_timing = 0, dma_timing = 0;
|
||||
|
||||
if (drive->dn >= ARRAY_SIZE(drive_pci2))
|
||||
return;
|
||||
|
||||
pci_read_config_byte(dev, (0x56|hwif->channel), &ultra_timing);
|
||||
pci_read_config_byte(dev, 0x54, &ultra_enable);
|
||||
|
||||
|
|
|
@ -648,8 +648,7 @@ static void sil_quirkproc(ide_drive_t *drive)
|
|||
|
||||
static void init_iops_siimage(ide_hwif_t *hwif)
|
||||
{
|
||||
struct pci_dev *dev = to_pci_dev(hwif->dev);
|
||||
struct ide_host *host = pci_get_drvdata(dev);
|
||||
struct ide_host *host = dev_get_drvdata(hwif->dev);
|
||||
|
||||
hwif->hwif_data = NULL;
|
||||
|
||||
|
|
|
@ -549,7 +549,7 @@ static int __init tx4939ide_probe(struct platform_device *pdev)
|
|||
return -ENODEV;
|
||||
|
||||
if (!devm_request_mem_region(&pdev->dev, res->start,
|
||||
resource_size(res), "tx4938ide"))
|
||||
resource_size(res), MODNAME))
|
||||
return -EBUSY;
|
||||
mapbase = (unsigned long)devm_ioremap(&pdev->dev, res->start,
|
||||
resource_size(res));
|
||||
|
|
|
@ -175,8 +175,7 @@ static void via_set_speed(ide_hwif_t *hwif, u8 dn, struct ide_timing *timing)
|
|||
static void via_set_drive(ide_hwif_t *hwif, ide_drive_t *drive)
|
||||
{
|
||||
ide_drive_t *peer = ide_get_pair_dev(drive);
|
||||
struct pci_dev *dev = to_pci_dev(hwif->dev);
|
||||
struct ide_host *host = pci_get_drvdata(dev);
|
||||
struct ide_host *host = dev_get_drvdata(hwif->dev);
|
||||
struct via82cxxx_dev *vdev = host->host_priv;
|
||||
struct ide_timing t, p;
|
||||
unsigned int T, UT;
|
||||
|
|
|
@ -945,6 +945,10 @@ ide_devset_get(_name, _field); \
|
|||
ide_devset_set(_name, _field); \
|
||||
IDE_DEVSET(_name, DS_SYNC, get_##_name, set_##_name)
|
||||
|
||||
#define ide_devset_ro_field(_name, _field) \
|
||||
ide_devset_get(_name, _field); \
|
||||
IDE_DEVSET(_name, 0, get_##_name, NULL)
|
||||
|
||||
#define ide_devset_rw_flag(_name, _field) \
|
||||
ide_devset_get_flag(_name, _field); \
|
||||
ide_devset_set_flag(_name, _field); \
|
||||
|
|
Loading…
Reference in New Issue
Block a user