-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[media] gspca: ov534/topro: use a define for the default framerate
When writing the change in commit dcc7fdb ("[media] gspca: ov534/topro: prevent a division by 0") I used magic numbers for the default framerate to minimize the code footprint to make it easier to backport the patch to the stable trees. However it's better if the default framerate has its own define to avoid risking using different values in different places, and for readability. While at it also remove some trivial comments about the framerates which don't add much to the code anymore. Signed-off-by: Antonio Ospite <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
- Loading branch information
Showing
2 changed files
with
7 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,6 +51,7 @@ | |
#define OV534_OP_READ_2 0xf9 | ||
|
||
#define CTRL_TIMEOUT 500 | ||
#define DEFAULT_FRAME_RATE 30 | ||
|
||
MODULE_AUTHOR("Antonio Ospite <[email protected]>"); | ||
MODULE_DESCRIPTION("GSPCA/OV534 USB Camera Driver"); | ||
|
@@ -1061,7 +1062,7 @@ static int sd_config(struct gspca_dev *gspca_dev, | |
cam->cam_mode = ov772x_mode; | ||
cam->nmodes = ARRAY_SIZE(ov772x_mode); | ||
|
||
sd->frame_rate = 30; | ||
sd->frame_rate = DEFAULT_FRAME_RATE; | ||
|
||
return 0; | ||
} | ||
|
@@ -1492,10 +1493,8 @@ static void sd_set_streamparm(struct gspca_dev *gspca_dev, | |
struct sd *sd = (struct sd *) gspca_dev; | ||
|
||
if (tpf->numerator == 0 || tpf->denominator == 0) | ||
/* Set default framerate */ | ||
sd->frame_rate = 30; | ||
sd->frame_rate = DEFAULT_FRAME_RATE; | ||
else | ||
/* Set requested framerate */ | ||
sd->frame_rate = tpf->denominator / tpf->numerator; | ||
|
||
if (gspca_dev->streaming) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters