/* Selects a w1 channel. The 1-wire interface must be idle before calling this function. */
static int ds2482_set_channel(struct ds2482_data *pdev, u8 channel)
/* Selects a w1 channel. The 1-wire interface must be idle before calling this function. */
static int ds2482_set_channel(struct ds2482_data *pdev, u8 channel)
{
	if (i2c_smbus_write_byte_data(pdev->client, DS2482_CMD_CHANNEL_SELECT,
				      ds2482_chan_wr[channel]) < 0)
		return -1;
	pdev->read_prt = DS2482_PTR_CODE_CHANNEL;
	pdev->channel = -1;
	if (i2c_smbus_read_byte(pdev->client) == ds2482_chan_rd[channel]) {
		pdev->channel = channel;
		return 0;
	}
	return -1;
}