Skip to content

Commit

Permalink
iio: Rename _st_ functions to loose the bit that meant the staging ve…
Browse files Browse the repository at this point in the history
…rsion.

These were originally introduced when the plan was to have parallel
IIO cores in and out of staging with a slow move between them.
Now we have reached the point where the whole core has moved,
they need clearing up!

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
  • Loading branch information
Jonathan Cameron committed Jun 30, 2012
1 parent 6a17a07 commit 314be14
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 41 deletions.
33 changes: 15 additions & 18 deletions drivers/iio/inkern.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,7 @@ int iio_map_array_unregister(struct iio_dev *indio_dev,
EXPORT_SYMBOL_GPL(iio_map_array_unregister);

static const struct iio_chan_spec
*iio_chan_spec_from_name(const struct iio_dev *indio_dev,
const char *name)
*iio_chan_spec_from_name(const struct iio_dev *indio_dev, const char *name)
{
int i;
const struct iio_chan_spec *chan = NULL;
Expand All @@ -108,8 +107,7 @@ static const struct iio_chan_spec
}


struct iio_channel *iio_st_channel_get(const char *name,
const char *channel_name)
struct iio_channel *iio_channel_get(const char *name, const char *channel_name)
{
struct iio_map_internal *c_i = NULL, *c = NULL;
struct iio_channel *channel;
Expand Down Expand Up @@ -145,16 +143,16 @@ struct iio_channel *iio_st_channel_get(const char *name,

return channel;
}
EXPORT_SYMBOL_GPL(iio_st_channel_get);
EXPORT_SYMBOL_GPL(iio_channel_get);

void iio_st_channel_release(struct iio_channel *channel)
void iio_channel_release(struct iio_channel *channel)
{
iio_device_put(channel->indio_dev);
kfree(channel);
}
EXPORT_SYMBOL_GPL(iio_st_channel_release);
EXPORT_SYMBOL_GPL(iio_channel_release);

struct iio_channel *iio_st_channel_get_all(const char *name)
struct iio_channel *iio_channel_get_all(const char *name)
{
struct iio_channel *chans;
struct iio_map_internal *c = NULL;
Expand Down Expand Up @@ -217,9 +215,9 @@ struct iio_channel *iio_st_channel_get_all(const char *name)

return ERR_PTR(ret);
}
EXPORT_SYMBOL_GPL(iio_st_channel_get_all);
EXPORT_SYMBOL_GPL(iio_channel_get_all);

void iio_st_channel_release_all(struct iio_channel *channels)
void iio_channel_release_all(struct iio_channel *channels)
{
struct iio_channel *chan = &channels[0];

Expand All @@ -229,9 +227,9 @@ void iio_st_channel_release_all(struct iio_channel *channels)
}
kfree(channels);
}
EXPORT_SYMBOL_GPL(iio_st_channel_release_all);
EXPORT_SYMBOL_GPL(iio_channel_release_all);

int iio_st_read_channel_raw(struct iio_channel *chan, int *val)
int iio_read_channel_raw(struct iio_channel *chan, int *val)
{
int val2, ret;

Expand All @@ -248,9 +246,9 @@ int iio_st_read_channel_raw(struct iio_channel *chan, int *val)

return ret;
}
EXPORT_SYMBOL_GPL(iio_st_read_channel_raw);
EXPORT_SYMBOL_GPL(iio_read_channel_raw);

int iio_st_read_channel_scale(struct iio_channel *chan, int *val, int *val2)
int iio_read_channel_scale(struct iio_channel *chan, int *val, int *val2)
{
int ret;

Expand All @@ -269,10 +267,9 @@ int iio_st_read_channel_scale(struct iio_channel *chan, int *val, int *val2)

return ret;
}
EXPORT_SYMBOL_GPL(iio_st_read_channel_scale);
EXPORT_SYMBOL_GPL(iio_read_channel_scale);

int iio_st_get_channel_type(struct iio_channel *chan,
enum iio_chan_type *type)
int iio_get_channel_type(struct iio_channel *chan, enum iio_chan_type *type)
{
int ret = 0;
/* Need to verify underlying driver has not gone away */
Expand All @@ -289,4 +286,4 @@ int iio_st_get_channel_type(struct iio_channel *chan,

return ret;
}
EXPORT_SYMBOL_GPL(iio_st_get_channel_type);
EXPORT_SYMBOL_GPL(iio_get_channel_type);
12 changes: 6 additions & 6 deletions drivers/staging/iio/iio_hwmon.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ static ssize_t iio_hwmon_read_val(struct device *dev,
* No locking between this pair, so theoretically possible
* the scale has changed.
*/
ret = iio_st_read_channel_raw(&state->channels[sattr->index],
ret = iio_read_channel_raw(&state->channels[sattr->index],
&val);
if (ret < 0)
return ret;

ret = iio_st_read_channel_scale(&state->channels[sattr->index],
ret = iio_read_channel_scale(&state->channels[sattr->index],
&scaleint, &scalepart);
if (ret < 0)
return ret;
Expand Down Expand Up @@ -106,7 +106,7 @@ static int __devinit iio_hwmon_probe(struct platform_device *pdev)
goto error_ret;
}

st->channels = iio_st_channel_get_all(dev_name(&pdev->dev));
st->channels = iio_channel_get_all(dev_name(&pdev->dev));
if (IS_ERR(st->channels)) {
ret = PTR_ERR(st->channels);
goto error_free_state;
Expand All @@ -130,7 +130,7 @@ static int __devinit iio_hwmon_probe(struct platform_device *pdev)
}

sysfs_attr_init(&a->dev_attr.attr);
ret = iio_st_get_channel_type(&st->channels[i], &type);
ret = iio_get_channel_type(&st->channels[i], &type);
if (ret < 0) {
kfree(a);
goto error_free_attrs;
Expand Down Expand Up @@ -186,7 +186,7 @@ static int __devinit iio_hwmon_probe(struct platform_device *pdev)
iio_hwmon_free_attrs(st);
kfree(st->attrs);
error_release_channels:
iio_st_channel_release_all(st->channels);
iio_channel_release_all(st->channels);
error_free_state:
kfree(st);
error_ret:
Expand All @@ -201,7 +201,7 @@ static int __devexit iio_hwmon_remove(struct platform_device *pdev)
sysfs_remove_group(&pdev->dev.kobj, &st->attr_group);
iio_hwmon_free_attrs(st);
kfree(st->attrs);
iio_st_channel_release_all(st->channels);
iio_channel_release_all(st->channels);

return 0;
}
Expand Down
34 changes: 17 additions & 17 deletions include/linux/iio/consumer.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,55 +33,55 @@ struct iio_channel {
* side. This typically describes the channels use within
* the consumer. E.g. 'battery_voltage'
*/
struct iio_channel *iio_st_channel_get(const char *name,
const char *consumer_channel);
struct iio_channel *iio_channel_get(const char *name,
const char *consumer_channel);

/**
* iio_st_channel_release() - release channels obtained via iio_st_channel_get
* iio_channel_release() - release channels obtained via iio_channel_get
* @chan: The channel to be released.
*/
void iio_st_channel_release(struct iio_channel *chan);
void iio_channel_release(struct iio_channel *chan);

/**
* iio_st_channel_get_all() - get all channels associated with a client
* iio_channel_get_all() - get all channels associated with a client
* @name: name of consumer device.
*
* Returns an array of iio_channel structures terminated with one with
* null iio_dev pointer.
* This function is used by fairly generic consumers to get all the
* channels registered as having this consumer.
*/
struct iio_channel *iio_st_channel_get_all(const char *name);
struct iio_channel *iio_channel_get_all(const char *name);

/**
* iio_st_channel_release_all() - reverse iio_st_get_all
* iio_channel_release_all() - reverse iio_channel_get_all
* @chan: Array of channels to be released.
*/
void iio_st_channel_release_all(struct iio_channel *chan);
void iio_channel_release_all(struct iio_channel *chan);

/**
* iio_st_read_channel_raw() - read from a given channel
* iio_read_channel_raw() - read from a given channel
* @channel: The channel being queried.
* @val: Value read back.
*
* Note raw reads from iio channels are in adc counts and hence
* scale will need to be applied if standard units required.
*/
int iio_st_read_channel_raw(struct iio_channel *chan,
int *val);
int iio_read_channel_raw(struct iio_channel *chan,
int *val);

/**
* iio_st_get_channel_type() - get the type of a channel
* iio_get_channel_type() - get the type of a channel
* @channel: The channel being queried.
* @type: The type of the channel.
*
* returns the enum iio_chan_type of the channel
*/
int iio_st_get_channel_type(struct iio_channel *channel,
enum iio_chan_type *type);
int iio_get_channel_type(struct iio_channel *channel,
enum iio_chan_type *type);

/**
* iio_st_read_channel_scale() - read the scale value for a channel
* iio_read_channel_scale() - read the scale value for a channel
* @channel: The channel being queried.
* @val: First part of value read back.
* @val2: Second part of value read back.
Expand All @@ -90,7 +90,7 @@ int iio_st_get_channel_type(struct iio_channel *channel,
* as IIO_VAL_INT_PLUS_MICRO telling us we have a value of val
* + val2/1e6
*/
int iio_st_read_channel_scale(struct iio_channel *chan, int *val,
int *val2);
int iio_read_channel_scale(struct iio_channel *chan, int *val,
int *val2);

#endif

0 comments on commit 314be14

Please sign in to comment.