|
@@ -208,6 +208,7 @@ static int si470x_set_band(struct si470x_device *radio, int band)
|
|
static int si470x_set_chan(struct si470x_device *radio, unsigned short chan)
|
|
static int si470x_set_chan(struct si470x_device *radio, unsigned short chan)
|
|
{
|
|
{
|
|
int retval;
|
|
int retval;
|
|
|
|
+ unsigned long time_left;
|
|
bool timed_out = false;
|
|
bool timed_out = false;
|
|
|
|
|
|
/* start tuning */
|
|
/* start tuning */
|
|
@@ -219,9 +220,9 @@ static int si470x_set_chan(struct si470x_device *radio, unsigned short chan)
|
|
|
|
|
|
/* wait till tune operation has completed */
|
|
/* wait till tune operation has completed */
|
|
reinit_completion(&radio->completion);
|
|
reinit_completion(&radio->completion);
|
|
- retval = wait_for_completion_timeout(&radio->completion,
|
|
|
|
- msecs_to_jiffies(tune_timeout));
|
|
|
|
- if (!retval)
|
|
|
|
|
|
+ time_left = wait_for_completion_timeout(&radio->completion,
|
|
|
|
+ msecs_to_jiffies(tune_timeout));
|
|
|
|
+ if (time_left == 0)
|
|
timed_out = true;
|
|
timed_out = true;
|
|
|
|
|
|
if ((radio->registers[STATUSRSSI] & STATUSRSSI_STC) == 0)
|
|
if ((radio->registers[STATUSRSSI] & STATUSRSSI_STC) == 0)
|
|
@@ -301,6 +302,7 @@ static int si470x_set_seek(struct si470x_device *radio,
|
|
int band, retval;
|
|
int band, retval;
|
|
unsigned int freq;
|
|
unsigned int freq;
|
|
bool timed_out = false;
|
|
bool timed_out = false;
|
|
|
|
+ unsigned long time_left;
|
|
|
|
|
|
/* set band */
|
|
/* set band */
|
|
if (seek->rangelow || seek->rangehigh) {
|
|
if (seek->rangelow || seek->rangehigh) {
|
|
@@ -342,9 +344,9 @@ static int si470x_set_seek(struct si470x_device *radio,
|
|
|
|
|
|
/* wait till tune operation has completed */
|
|
/* wait till tune operation has completed */
|
|
reinit_completion(&radio->completion);
|
|
reinit_completion(&radio->completion);
|
|
- retval = wait_for_completion_timeout(&radio->completion,
|
|
|
|
- msecs_to_jiffies(seek_timeout));
|
|
|
|
- if (!retval)
|
|
|
|
|
|
+ time_left = wait_for_completion_timeout(&radio->completion,
|
|
|
|
+ msecs_to_jiffies(seek_timeout));
|
|
|
|
+ if (time_left == 0)
|
|
timed_out = true;
|
|
timed_out = true;
|
|
|
|
|
|
if ((radio->registers[STATUSRSSI] & STATUSRSSI_STC) == 0)
|
|
if ((radio->registers[STATUSRSSI] & STATUSRSSI_STC) == 0)
|