Skip to content

Commit

Permalink
Merge tag 'staging-3.6-rc3' of git://git.kernel.org/pub/scm/linux/ker…
Browse files Browse the repository at this point in the history
…nel/git/gregkh/staging

Pull staging fixes from Greg Kroah-Hartman:
 "Here are some staging driver fixes (and iio driver fixes, they get
  lumped in with the staging stuff due to dependancies) for your 3.6-rc3
  tree.

  Nothing major, just a bunch of fixes that people have reported.

  Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>"

* tag 'staging-3.6-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (26 commits)
  iio: lm3533-als: Fix build warnings
  staging:iio:ad7780: Mark channels as unsigned
  staging:iio:ad7192: Report offset and scale for temperature channel
  staging:iio:ad7192: Report channel offset
  staging:iio:ad7192: Mark channels as unsigned
  staging:iio:ad7192: Fix setting ACX
  staging:iio:ad7192: Add missing break in switch statement
  staging:iio:ad7793: Fix internal reference value
  staging:iio:ad7793: Follow new IIO naming spec
  staging:iio:ad7793: Fix temperature scale and offset
  staging:iio:ad7793: Report channel offset
  staging:iio:ad7793: Mark channels as unsigned
  staging:iio:ad7793: Add missing break in switch statement
  iio/adjd_s311: Fix potential memory leak in adjd_s311_update_scan_mode()
  iio: frequency: ADF4350: Fix potential reference div factor overflow.
  iio: staging: ad7298_ring: Fix maybe-uninitialized warning
  staging: comedi: usbduxfast: Declare MODULE_FIRMWARE usage
  staging: comedi: usbdux: Declare MODULE_FIRMWARE usage
  staging: comedi: usbduxsigma: Declare MODULE_FIRMWARE usage
  staging: csr: add INET dependancy
  ...
  • Loading branch information
Linus Torvalds committed Aug 17, 2012
2 parents c839179 + 3a491ae commit 557e2e2
Show file tree
Hide file tree
Showing 19 changed files with 150 additions and 118 deletions.
24 changes: 15 additions & 9 deletions drivers/iio/frequency/adf4350.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ static int adf4350_set_freq(struct adf4350_state *st, unsigned long long freq)
{
struct adf4350_platform_data *pdata = st->pdata;
u64 tmp;
u32 div_gcd, prescaler;
u32 div_gcd, prescaler, chspc;
u16 mdiv, r_cnt = 0;
u8 band_sel_div;

Expand Down Expand Up @@ -158,14 +158,20 @@ static int adf4350_set_freq(struct adf4350_state *st, unsigned long long freq)
if (pdata->ref_div_factor)
r_cnt = pdata->ref_div_factor - 1;

do {
r_cnt = adf4350_tune_r_cnt(st, r_cnt);
chspc = st->chspc;

st->r1_mod = st->fpfd / st->chspc;
while (st->r1_mod > ADF4350_MAX_MODULUS) {
r_cnt = adf4350_tune_r_cnt(st, r_cnt);
st->r1_mod = st->fpfd / st->chspc;
}
do {
do {
do {
r_cnt = adf4350_tune_r_cnt(st, r_cnt);
st->r1_mod = st->fpfd / chspc;
if (r_cnt > ADF4350_MAX_R_CNT) {
/* try higher spacing values */
chspc++;
r_cnt = 0;
}
} while ((st->r1_mod > ADF4350_MAX_MODULUS) && r_cnt);
} while (r_cnt == 0);

tmp = freq * (u64)st->r1_mod + (st->fpfd > 1);
do_div(tmp, st->fpfd); /* Div round closest (n + d/2)/d */
Expand Down Expand Up @@ -194,7 +200,7 @@ static int adf4350_set_freq(struct adf4350_state *st, unsigned long long freq)
st->regs[ADF4350_REG0] = ADF4350_REG0_INT(st->r0_int) |
ADF4350_REG0_FRACT(st->r0_fract);

st->regs[ADF4350_REG1] = ADF4350_REG1_PHASE(0) |
st->regs[ADF4350_REG1] = ADF4350_REG1_PHASE(1) |
ADF4350_REG1_MOD(st->r1_mod) |
prescaler;

Expand Down
7 changes: 4 additions & 3 deletions drivers/iio/light/adjd_s311.c
Original file line number Diff line number Diff line change
Expand Up @@ -271,9 +271,10 @@ static int adjd_s311_update_scan_mode(struct iio_dev *indio_dev,
const unsigned long *scan_mask)
{
struct adjd_s311_data *data = iio_priv(indio_dev);
data->buffer = krealloc(data->buffer, indio_dev->scan_bytes,
GFP_KERNEL);
if (!data->buffer)

kfree(data->buffer);
data->buffer = kmalloc(indio_dev->scan_bytes, GFP_KERNEL);
if (data->buffer == NULL)
return -ENOMEM;

return 0;
Expand Down
4 changes: 2 additions & 2 deletions drivers/iio/light/lm3533-als.c
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ static int lm3533_als_get_hysteresis(struct iio_dev *indio_dev, unsigned nr,
return ret;
}

static int show_thresh_either_en(struct device *dev,
static ssize_t show_thresh_either_en(struct device *dev,
struct device_attribute *attr,
char *buf)
{
Expand All @@ -424,7 +424,7 @@ static int show_thresh_either_en(struct device *dev,
return scnprintf(buf, PAGE_SIZE, "%u\n", enable);
}

static int store_thresh_either_en(struct device *dev,
static ssize_t store_thresh_either_en(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t len)
{
Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/comedi/drivers.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ int comedi_device_attach(struct comedi_device *dev, struct comedi_devconfig *it)
dev->board_ptr = comedi_recognize(driv, it->board_name);
if (dev->board_ptr)
break;
} else if (strcmp(driv->driver_name, it->board_name))
} else if (strcmp(driv->driver_name, it->board_name) == 0)
break;
module_put(driv->module);
}
Expand Down
3 changes: 0 additions & 3 deletions drivers/staging/comedi/drivers/adv_pci1710.c
Original file line number Diff line number Diff line change
Expand Up @@ -1349,9 +1349,6 @@ static struct pci_dev *pci1710_find_pci_dev(struct comedi_device *dev,
}
if (pcidev->vendor != PCI_VENDOR_ID_ADVANTECH)
continue;
if (pci_is_enabled(pcidev))
continue;

if (strcmp(this_board->name, DRV_NAME) == 0) {
for (i = 0; i < ARRAY_SIZE(boardtypes); ++i) {
if (pcidev->device == boardtypes[i].device_id) {
Expand Down
2 changes: 0 additions & 2 deletions drivers/staging/comedi/drivers/adv_pci1723.c
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,6 @@ static struct pci_dev *pci1723_find_pci_dev(struct comedi_device *dev,
}
if (pcidev->vendor != PCI_VENDOR_ID_ADVANTECH)
continue;
if (pci_is_enabled(pcidev))
continue;
return pcidev;
}
dev_err(dev->class_dev,
Expand Down
2 changes: 0 additions & 2 deletions drivers/staging/comedi/drivers/adv_pci_dio.c
Original file line number Diff line number Diff line change
Expand Up @@ -1064,8 +1064,6 @@ static struct pci_dev *pci_dio_find_pci_dev(struct comedi_device *dev,
slot != PCI_SLOT(pcidev->devfn))
continue;
}
if (pci_is_enabled(pcidev))
continue;
for (i = 0; i < ARRAY_SIZE(boardtypes); ++i) {
if (boardtypes[i].vendor_id != pcidev->vendor)
continue;
Expand Down
17 changes: 9 additions & 8 deletions drivers/staging/comedi/drivers/daqboard2000.c
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,8 @@ static struct pci_dev *daqboard2000_find_pci_dev(struct comedi_device *dev,
continue;
}
if (pcidev->vendor != PCI_VENDOR_ID_IOTECH ||
pcidev->device != 0x0409)
pcidev->device != 0x0409 ||
pcidev->subsystem_device != PCI_VENDOR_ID_IOTECH)
continue;

for (i = 0; i < ARRAY_SIZE(boardtypes); i++) {
Expand All @@ -739,6 +740,7 @@ static int daqboard2000_attach(struct comedi_device *dev,
{
struct pci_dev *pcidev;
struct comedi_subdevice *s;
resource_size_t pci_base;
void *aux_data;
unsigned int aux_len;
int result;
Expand All @@ -758,11 +760,12 @@ static int daqboard2000_attach(struct comedi_device *dev,
"failed to enable PCI device and request regions\n");
return -EIO;
}
dev->iobase = pci_resource_start(pcidev, 2);
dev->iobase = 1; /* the "detach" needs this */

devpriv->plx =
ioremap(pci_resource_start(pcidev, 0), DAQBOARD2000_PLX_SIZE);
devpriv->daq = ioremap(dev->iobase, DAQBOARD2000_DAQ_SIZE);
pci_base = pci_resource_start(pcidev, 0);
devpriv->plx = ioremap(pci_base, DAQBOARD2000_PLX_SIZE);
pci_base = pci_resource_start(pcidev, 2);
devpriv->daq = ioremap(pci_base, DAQBOARD2000_DAQ_SIZE);
if (!devpriv->plx || !devpriv->daq)
return -ENOMEM;

Expand Down Expand Up @@ -799,8 +802,6 @@ static int daqboard2000_attach(struct comedi_device *dev,
printk("Interrupt after is: %x\n", interrupt);
*/

dev->iobase = (unsigned long)devpriv->daq;

dev->board_name = this_board->name;

s = dev->subdevices + 0;
Expand All @@ -824,7 +825,7 @@ static int daqboard2000_attach(struct comedi_device *dev,

s = dev->subdevices + 2;
result = subdev_8255_init(dev, s, daqboard2000_8255_cb,
(unsigned long)(dev->iobase + 0x40));
(unsigned long)(devpriv->daq + 0x40));

out:
return result;
Expand Down
6 changes: 4 additions & 2 deletions drivers/staging/comedi/drivers/dt3000.c
Original file line number Diff line number Diff line change
Expand Up @@ -804,6 +804,7 @@ static int dt3000_attach(struct comedi_device *dev, struct comedi_devconfig *it)
{
struct pci_dev *pcidev;
struct comedi_subdevice *s;
resource_size_t pci_base;
int ret = 0;

dev_dbg(dev->class_dev, "dt3000:\n");
Expand All @@ -820,9 +821,10 @@ static int dt3000_attach(struct comedi_device *dev, struct comedi_devconfig *it)
ret = comedi_pci_enable(pcidev, "dt3000");
if (ret < 0)
return ret;
dev->iobase = 1; /* the "detach" needs this */

dev->iobase = pci_resource_start(pcidev, 0);
devpriv->io_addr = ioremap(dev->iobase, DT3000_SIZE);
pci_base = pci_resource_start(pcidev, 0);
devpriv->io_addr = ioremap(pci_base, DT3000_SIZE);
if (!devpriv->io_addr)
return -ENOMEM;

Expand Down
26 changes: 10 additions & 16 deletions drivers/staging/comedi/drivers/rtd520.c
Original file line number Diff line number Diff line change
Expand Up @@ -1619,9 +1619,8 @@ static int rtd_attach(struct comedi_device *dev, struct comedi_devconfig *it)
struct rtdPrivate *devpriv;
struct pci_dev *pcidev;
struct comedi_subdevice *s;
resource_size_t pci_base;
int ret;
resource_size_t physLas1; /* data area */
resource_size_t physLcfg; /* PLX9080 */
#ifdef USE_DMA
int index;
#endif
Expand Down Expand Up @@ -1655,20 +1654,15 @@ static int rtd_attach(struct comedi_device *dev, struct comedi_devconfig *it)
printk(KERN_INFO "Failed to enable PCI device and request regions.\n");
return ret;
}

/*
* Initialize base addresses
*/
/* Get the physical address from PCI config */
dev->iobase = pci_resource_start(pcidev, LAS0_PCIINDEX);
physLas1 = pci_resource_start(pcidev, LAS1_PCIINDEX);
physLcfg = pci_resource_start(pcidev, LCFG_PCIINDEX);
/* Now have the kernel map this into memory */
/* ASSUME page aligned */
devpriv->las0 = ioremap_nocache(dev->iobase, LAS0_PCISIZE);
devpriv->las1 = ioremap_nocache(physLas1, LAS1_PCISIZE);
devpriv->lcfg = ioremap_nocache(physLcfg, LCFG_PCISIZE);

dev->iobase = 1; /* the "detach" needs this */

/* Initialize the base addresses */
pci_base = pci_resource_start(pcidev, LAS0_PCIINDEX);
devpriv->las0 = ioremap_nocache(pci_base, LAS0_PCISIZE);
pci_base = pci_resource_start(pcidev, LAS1_PCIINDEX);
devpriv->las1 = ioremap_nocache(pci_base, LAS1_PCISIZE);
pci_base = pci_resource_start(pcidev, LCFG_PCIINDEX);
devpriv->lcfg = ioremap_nocache(pci_base, LCFG_PCISIZE);
if (!devpriv->las0 || !devpriv->las1 || !devpriv->lcfg)
return -ENOMEM;

Expand Down
4 changes: 3 additions & 1 deletion drivers/staging/comedi/drivers/usbdux.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ sampling rate. If you sample two channels you get 4kHz and so on.
#define BULK_TIMEOUT 1000

/* constants for "firmware" upload and download */
#define FIRMWARE "usbdux_firmware.bin"
#define USBDUXSUB_FIRMWARE 0xA0
#define VENDOR_DIR_IN 0xC0
#define VENDOR_DIR_OUT 0x40
Expand Down Expand Up @@ -2791,7 +2792,7 @@ static int usbdux_usb_probe(struct usb_interface *uinterf,

ret = request_firmware_nowait(THIS_MODULE,
FW_ACTION_HOTPLUG,
"usbdux_firmware.bin",
FIRMWARE,
&udev->dev,
GFP_KERNEL,
usbduxsub + index,
Expand Down Expand Up @@ -2850,3 +2851,4 @@ module_comedi_usb_driver(usbdux_driver, usbdux_usb_driver);
MODULE_AUTHOR("Bernd Porr, BerndPorr@f2s.com");
MODULE_DESCRIPTION("Stirling/ITL USB-DUX -- Bernd.Porr@f2s.com");
MODULE_LICENSE("GPL");
MODULE_FIRMWARE(FIRMWARE);
4 changes: 3 additions & 1 deletion drivers/staging/comedi/drivers/usbduxfast.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
/*
* constants for "firmware" upload and download
*/
#define FIRMWARE "usbduxfast_firmware.bin"
#define USBDUXFASTSUB_FIRMWARE 0xA0
#define VENDOR_DIR_IN 0xC0
#define VENDOR_DIR_OUT 0x40
Expand Down Expand Up @@ -1706,7 +1707,7 @@ static int usbduxfast_usb_probe(struct usb_interface *uinterf,

ret = request_firmware_nowait(THIS_MODULE,
FW_ACTION_HOTPLUG,
"usbduxfast_firmware.bin",
FIRMWARE,
&udev->dev,
GFP_KERNEL,
usbduxfastsub + index,
Expand Down Expand Up @@ -1774,3 +1775,4 @@ module_comedi_usb_driver(usbduxfast_driver, usbduxfast_usb_driver);
MODULE_AUTHOR("Bernd Porr, BerndPorr@f2s.com");
MODULE_DESCRIPTION("USB-DUXfast, BerndPorr@f2s.com");
MODULE_LICENSE("GPL");
MODULE_FIRMWARE(FIRMWARE);
4 changes: 3 additions & 1 deletion drivers/staging/comedi/drivers/usbduxsigma.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ Status: testing
#define BULK_TIMEOUT 1000

/* constants for "firmware" upload and download */
#define FIRMWARE "usbduxsigma_firmware.bin"
#define USBDUXSUB_FIRMWARE 0xA0
#define VENDOR_DIR_IN 0xC0
#define VENDOR_DIR_OUT 0x40
Expand Down Expand Up @@ -2780,7 +2781,7 @@ static int usbduxsigma_usb_probe(struct usb_interface *uinterf,

ret = request_firmware_nowait(THIS_MODULE,
FW_ACTION_HOTPLUG,
"usbduxsigma_firmware.bin",
FIRMWARE,
&udev->dev,
GFP_KERNEL,
usbduxsub + index,
Expand Down Expand Up @@ -2845,3 +2846,4 @@ module_comedi_usb_driver(usbduxsigma_driver, usbduxsigma_usb_driver);
MODULE_AUTHOR("Bernd Porr, BerndPorr@f2s.com");
MODULE_DESCRIPTION("Stirling/ITL USB-DUX SIGMA -- Bernd.Porr@f2s.com");
MODULE_LICENSE("GPL");
MODULE_FIRMWARE(FIRMWARE);
2 changes: 1 addition & 1 deletion drivers/staging/csr/Kconfig
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
config CSR_WIFI
tristate "CSR wireless driver"
depends on MMC && CFG80211_WEXT
depends on MMC && CFG80211_WEXT && INET
select WIRELESS_EXT
select WEXT_PRIV
help
Expand Down
Loading

0 comments on commit 557e2e2

Please sign in to comment.