Commit fd1b821c authored by Tomas Winkler's avatar Tomas Winkler Committed by Greg Kroah-Hartman

staging/easycap: revamp reset function

fix indentation and drop success statements printouts
that just causes code be less readable
Signed-off-by: default avatarTomas Winkler <tomas.winkler@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 19cb2848
...@@ -201,9 +201,9 @@ static int easycap_open(struct inode *inode, struct file *file) ...@@ -201,9 +201,9 @@ static int easycap_open(struct inode *inode, struct file *file)
static int reset(struct easycap *peasycap) static int reset(struct easycap *peasycap)
{ {
struct easycap_standard const *peasycap_standard; struct easycap_standard const *peasycap_standard;
int i, rc, input, rate; int fmtidx, input, rate;
bool ntsc, other; bool ntsc, other;
int fmtidx; int rc;
if (!peasycap) { if (!peasycap) {
SAY("ERROR: peasycap is NULL\n"); SAY("ERROR: peasycap is NULL\n");
...@@ -226,30 +226,24 @@ static int reset(struct easycap *peasycap) ...@@ -226,30 +226,24 @@ static int reset(struct easycap *peasycap)
JOM(8, "peasycap->ntsc=%d\n", peasycap->ntsc); JOM(8, "peasycap->ntsc=%d\n", peasycap->ntsc);
rate = ready_saa(peasycap->pusb_device); rate = ready_saa(peasycap->pusb_device);
if (0 > rate) { if (rate < 0) {
JOM(8, "not ready to capture after %i ms ...\n", PATIENCE); JOM(8, "not ready to capture after %i ms ...\n", PATIENCE);
if (peasycap->ntsc) { ntsc = !peasycap->ntsc;
JOM(8, "... trying PAL ...\n"); ntsc = false; JOM(8, "... trying %s ..\n", ntsc ? "NTSC" : "PAL");
} else {
JOM(8, "... trying NTSC ...\n"); ntsc = true;
}
rc = setup_stk(peasycap->pusb_device, ntsc); rc = setup_stk(peasycap->pusb_device, ntsc);
if (0 == rc) if (rc) {
JOM(4, "setup_stk() OK\n");
else {
SAM("ERROR: setup_stk() rc = %i\n", rc); SAM("ERROR: setup_stk() rc = %i\n", rc);
return -EFAULT; return -EFAULT;
} }
rc = setup_saa(peasycap->pusb_device, ntsc); rc = setup_saa(peasycap->pusb_device, ntsc);
if (0 == rc) if (rc) {
JOM(4, "setup_saa() OK\n");
else {
SAM("ERROR: setup_saa() rc = %i\n", rc); SAM("ERROR: setup_saa() rc = %i\n", rc);
return -EFAULT; return -EFAULT;
} }
rate = ready_saa(peasycap->pusb_device); rate = ready_saa(peasycap->pusb_device);
if (0 > rate) { if (rate < 0) {
JOM(8, "not ready to capture after %i ms ...\n", PATIENCE); JOM(8, "not ready to capture after %i ms\n", PATIENCE);
JOM(8, "... saa register 0x1F has 0x%02X\n", JOM(8, "... saa register 0x1F has 0x%02X\n",
read_saa(peasycap->pusb_device, 0x1F)); read_saa(peasycap->pusb_device, 0x1F));
ntsc = peasycap->ntsc; ntsc = peasycap->ntsc;
...@@ -266,22 +260,17 @@ static int reset(struct easycap *peasycap) ...@@ -266,22 +260,17 @@ static int reset(struct easycap *peasycap)
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
rc = setup_stk(peasycap->pusb_device, ntsc); rc = setup_stk(peasycap->pusb_device, ntsc);
if (0 == rc) if (rc) {
JOM(4, "setup_stk() OK\n");
else {
SAM("ERROR: setup_stk() rc = %i\n", rc); SAM("ERROR: setup_stk() rc = %i\n", rc);
return -EFAULT; return -EFAULT;
} }
rc = setup_saa(peasycap->pusb_device, ntsc); rc = setup_saa(peasycap->pusb_device, ntsc);
if (0 == rc) if (rc) {
JOM(4, "setup_saa() OK\n");
else {
SAM("ERROR: setup_saa() rc = %i\n", rc); SAM("ERROR: setup_saa() rc = %i\n", rc);
return -EFAULT; return -EFAULT;
} }
for (i = 0; i < 180; i++) memset(peasycap->merit, 0, sizeof(peasycap->merit));
peasycap->merit[i] = 0;
peasycap->video_eof = 0; peasycap->video_eof = 0;
peasycap->audio_eof = 0; peasycap->audio_eof = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment