]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - drivers/media/platform/vimc/vimc-scaler.c
media: vimc: move duplicated IS_SRC and IS_SINK to common header
[linux.git] / drivers / media / platform / vimc / vimc-scaler.c
index 1a593d81ea7cc1e63071874f85de325625177418..a6a3cc5be8722becd31b45ffda646e597f9860cd 100644 (file)
@@ -16,8 +16,6 @@ static unsigned int sca_mult = 3;
 module_param(sca_mult, uint, 0000);
 MODULE_PARM_DESC(sca_mult, " the image size multiplier");
 
-#define IS_SINK(pad)   (!pad)
-#define IS_SRC(pad)    (pad)
 #define MAX_ZOOM       8
 
 struct vimc_sca_device {
@@ -93,7 +91,7 @@ static int vimc_sca_enum_frame_size(struct v4l2_subdev *sd,
        fse->min_width = VIMC_FRAME_MIN_WIDTH;
        fse->min_height = VIMC_FRAME_MIN_HEIGHT;
 
-       if (IS_SINK(fse->pad)) {
+       if (VIMC_IS_SINK(fse->pad)) {
                fse->max_width = VIMC_FRAME_MAX_WIDTH;
                fse->max_height = VIMC_FRAME_MAX_HEIGHT;
        } else {
@@ -116,7 +114,7 @@ static int vimc_sca_get_fmt(struct v4l2_subdev *sd,
                         vsca->sink_fmt;
 
        /* Scale the frame size for the source pad */
-       if (IS_SRC(format->pad)) {
+       if (VIMC_IS_SRC(format->pad)) {
                format->format.width = vsca->sink_fmt.width * sca_mult;
                format->format.height = vsca->sink_fmt.height * sca_mult;
        }
@@ -165,7 +163,7 @@ static int vimc_sca_set_fmt(struct v4l2_subdev *sd,
         * Do not change the format of the source pad,
         * it is propagated from the sink
         */
-       if (IS_SRC(fmt->pad)) {
+       if (VIMC_IS_SRC(fmt->pad)) {
                fmt->format = *sink_fmt;
                fmt->format.width = sink_fmt->width * sca_mult;
                fmt->format.height = sink_fmt->height * sca_mult;