Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 289157
b: refs/heads/master
c: 0339d3d
h: refs/heads/master
i:
  289155: 2754d65
v: v3
  • Loading branch information
Chris Kelly authored and Greg Kroah-Hartman committed Feb 29, 2012
1 parent d941012 commit 89f4a65
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 31 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: cd4361c7e2e0778016a770157d0ccf126fca7a2a
refs/heads/master: 0339d3dbbfd51348dda584796e59a740a57a7e32
36 changes: 12 additions & 24 deletions trunk/drivers/staging/iio/adc/max1363_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1245,31 +1245,10 @@ static int max1363_initial_setup(struct max1363_state *st)
return max1363_set_scan_mode(st);
}

static int __devinit max1363_alloc_scan_masks(struct iio_dev *indio_dev)
{
struct max1363_state *st = iio_priv(indio_dev);
unsigned long *masks;
int i;

masks = kzalloc(BITS_TO_LONGS(MAX1363_MAX_CHANNELS)*sizeof(long)*
(st->chip_info->num_modes + 1), GFP_KERNEL);
if (!masks)
return -ENOMEM;

for (i = 0; i < st->chip_info->num_modes; i++)
bitmap_copy(masks + BITS_TO_LONGS(MAX1363_MAX_CHANNELS)*i,
max1363_mode_table[st->chip_info->mode_list[i]]
.modemask, MAX1363_MAX_CHANNELS);

indio_dev->available_scan_masks = masks;

return 0;
}

static int __devinit max1363_probe(struct i2c_client *client,
const struct i2c_device_id *id)
{
int ret;
int ret, i;
struct max1363_state *st;
struct iio_dev *indio_dev;
struct regulator *reg;
Expand Down Expand Up @@ -1297,10 +1276,19 @@ static int __devinit max1363_probe(struct i2c_client *client,
st->chip_info = &max1363_chip_info_tbl[id->driver_data];
st->client = client;

ret = max1363_alloc_scan_masks(indio_dev);
if (ret)
indio_dev->available_scan_masks
= kzalloc(BITS_TO_LONGS(MAX1363_MAX_CHANNELS)*sizeof(long)*
(st->chip_info->num_modes + 1), GFP_KERNEL);
if (!indio_dev->available_scan_masks) {
ret = -ENOMEM;
goto error_free_device;
}

for (i = 0; i < st->chip_info->num_modes; i++)
bitmap_copy(indio_dev->available_scan_masks +
BITS_TO_LONGS(MAX1363_MAX_CHANNELS)*i,
max1363_mode_table[st->chip_info->mode_list[i]]
.modemask, MAX1363_MAX_CHANNELS);
/* Estabilish that the iio_dev is a child of the i2c device */
indio_dev->dev.parent = &client->dev;
indio_dev->name = id->name;
Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/staging/iio/buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ struct iio_buffer {
**/
void iio_buffer_init(struct iio_buffer *buffer);

void iio_buffer_deinit(struct iio_buffer *buffer);

/**
* __iio_update_buffer() - update common elements of buffers
* @buffer: buffer that is the event source
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/staging/iio/iio.h
Original file line number Diff line number Diff line change
Expand Up @@ -345,9 +345,9 @@ struct iio_dev {
struct iio_buffer *buffer;
struct mutex mlock;

const unsigned long *available_scan_masks;
unsigned long *available_scan_masks;
unsigned masklength;
const unsigned long *active_scan_mask;
unsigned long *active_scan_mask;
struct iio_trigger *trig;
struct iio_poll_func *pollfunc;

Expand Down
6 changes: 3 additions & 3 deletions trunk/drivers/staging/iio/industrialio-buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -489,9 +489,9 @@ ssize_t iio_buffer_show_enable(struct device *dev,
EXPORT_SYMBOL(iio_buffer_show_enable);

/* note NULL used as error indicator as it doesn't make sense. */
static const unsigned long *iio_scan_mask_match(const unsigned long *av_masks,
static unsigned long *iio_scan_mask_match(unsigned long *av_masks,
unsigned int masklength,
const unsigned long *mask)
unsigned long *mask)
{
if (bitmap_empty(mask, masklength))
return NULL;
Expand Down Expand Up @@ -554,7 +554,7 @@ EXPORT_SYMBOL(iio_sw_buffer_preenable);
int iio_scan_mask_set(struct iio_dev *indio_dev,
struct iio_buffer *buffer, int bit)
{
const unsigned long *mask;
unsigned long *mask;
unsigned long *trialmask;

trialmask = kmalloc(sizeof(*trialmask)*
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/staging/ozwpan/ozeventdef.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ struct oz_event {
unsigned ctx4;
};

#define OZ_EVT_LIST_SZ 256
#define OZ_EVT_LIST_SZ 64
struct oz_evtlist {
int count;
int missed;
Expand Down

0 comments on commit 89f4a65

Please sign in to comment.