Commit graph

1013521 commits

Author SHA1 Message Date
Hans Verkuil
3d37ef41be media: cobalt: fix race condition in setting HPD
The cobalt_s_bit_sysctrl reads the old register value over PCI,
then changes a bit and sets writes the new value to the register.

This is used among other things for setting the HPD output pin.

But if the HPD is changed for multiple inputs at the same time,
then this causes a race condition where a stale value is read.

Serialize this function with a mutex.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-05-19 09:51:39 +02:00
Hans Verkuil
b2cd0b31ed media: rtl2832_sdr/vivid/airspy/hackrf/msi2500: drop memset of fmt.sdr.reserved
The V4L2 core already zeroes fmt.sdr.reserved, so there is no need for
drivers to do the same.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-05-19 09:51:39 +02:00
Pavel Skripkin
be8656e62e media: cpia2: fix memory leak in cpia2_usb_probe
syzbot reported leak in cpia2 usb driver. The problem was
in invalid error handling.

v4l2_device_register() is called in cpia2_init_camera_struct(), but
all error cases after cpia2_init_camera_struct() did not call the
v4l2_device_unregister()

Reported-by: syzbot+d1e69c888f0d3866ead4@syzkaller.appspotmail.com
Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-05-19 09:51:39 +02:00
Sebastian Fricke
27ba44270b media: rkisp1: rkisp1-params.c: Fix typos
s/when the camera active/when the camera is active/
s/thus not isr protection/therefore there is no need to acquire a lock/

Signed-off-by: Sebastian Fricke <sebastian.fricke@posteo.net>
Reviewed-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-05-19 09:51:39 +02:00
Sebastian Fricke
71c4151812 media: rkisp1: rksip1-capture.c: Improve comments and fix typos
Improve the wording of the function description to increase readability.

Fix three typos:
s/during processing a frame/while processing a frame/
s/it also update/it also updates/
s/there's not buf in shadow/there's no buffer in a shadow register/

Replace the abbreviation 'buf' with the full word buffer, the
abbreviation 'config' with the verb configure, and 'regs' with registers.
The goal of this change is to ease the reading flow of the comment.

Signed-off-by: Sebastian Fricke <sebastian.fricke@posteo.net>
Reviewed-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-05-19 09:51:39 +02:00
Sebastian Fricke
b07006ff93 media: mc: mc-entity.c: Fix typo
s/entity in the other end/entity at the other end/

[hverkuil: also remove the spurious space after 'link']

Signed-off-by: Sebastian Fricke <sebastian.fricke@posteo.net>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-05-19 09:51:39 +02:00
Colin Ian King
4eb48acac1 media: s2255drv: remove redundant assignment to variable field
The variable 'field' is being assigned a value this is never read,
it is being updated in all the following if/else combinations. The
assignment is redundant and can be removed.

Addresses-Coverity: ("Unused value")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-05-19 09:51:39 +02:00
Deepak R Varma
637959f7e2 media: staging: media: atomisp: remove unnecessary pr_info calls
pr_info() messages to log function entry / exit tracing spams the log.
Such basic tracing is not necessary and be removed.

Signed-off-by: Deepak R Varma <drv@mailo.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-05-19 09:51:38 +02:00
Deepak R Varma
2dfc978ac0 media: staging: media: atomisp: replace raw pr_*() by dev_dbg()
It is recommended to use driver model diagnostic macros dev_*() instead
of raw printk() or pr_*() since the former ensures that the log messages
are always associated with the corresponding device and driver. This also
addresses the checkpatch complain for not using KERN_<LEVEL> facility in
printk() call.

Suggested-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Signed-off-by: Deepak R Varma <drv@mailo.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-05-19 09:51:38 +02:00
Deepak R Varma
4c999ae366 media: staging: media: atomisp: fix CamelCase variable naming
Mixed case variable names are discouraged and they result in checkpatch
script "Avoid CamelCase" warnings. Replace such CamelCase variable names
by lower case strings according to the coding style guidelines.

Signed-off-by: Deepak R Varma <drv@mailo.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-05-19 09:51:38 +02:00
Deepak R Varma
f50559f0c9 media: staging: media: atomisp: reformat code comment blocks
Reformat code comment blocks according to the coding style guidelines.
This resolves different checkpatch script WARNINGs around block comments.

[hverkuil: fixed up one missed '/* text' comment as reported by Fabio]

Suggested-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Signed-off-by: Deepak R Varma <drv@mailo.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-05-19 09:51:38 +02:00
Deepak R Varma
21837c2c27 media: staging: media: atomisp: remove unnecessary braces
According to the coding style guidelines, if...else blocks with single
instructions do not need enclosing braces. This resolves checkpatch
WARNING / CHECK complaints.

Signed-off-by: Deepak R Varma <drv@mailo.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-05-19 09:51:38 +02:00
Deepak R Varma
43692e9e1b media: staging: media: atomisp: balance braces around if...else block
Balance braces around the if else blocks as per the code style guidelines.
Add braces to branches where it is missing. Resolves checkpatch script
CHECK / WARNING feedback messages.

Signed-off-by: Deepak R Varma <drv@mailo.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-05-19 09:51:38 +02:00
Martiros Shakhzadyan
684e025c71 media: staging: media: atomisp: Fix line split style issues
Fix line split issues and resolve adjacent extra parens.

Signed-off-by: Martiros Shakhzadyan <vrzh@vrzh.net>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-05-19 09:51:38 +02:00
Martiros Shakhzadyan
58a328830e media: staging: media: atomisp: Refactor ia_css_stream_load()
Move the support check to the beginning of the function.
Change the logic to avoid multiple nesting blocks.
Move 'err' variable assignment outside of the if statement.
Remove an unnecessary check whether 'j' is zero.

Signed-off-by: Martiros Shakhzadyan <vrzh@vrzh.net>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-05-19 09:51:38 +02:00
Martiros Shakhzadyan
7796e45517 media: staging: media: atomisp: Fix alignment and line length issues
Fix alignment style issues and adjacent line length issues in sh_css.c

Signed-off-by: Martiros Shakhzadyan <vrzh@vrzh.net>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-05-19 09:51:38 +02:00
Martiros Shakhzadyan
d4bc34d182 media: staging: media: atomisp: Replace if else clause with a ternary
Use the ternary operator for conditional variable assignment in
create_host_video_pipeline().

Signed-off-by: Martiros Shakhzadyan <vrzh@vrzh.net>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-05-19 09:51:38 +02:00
Martiros Shakhzadyan
9d63454732 media: staging: media: atomisp: Remove a superfluous else clause in sh_css.c
Remove a superfluous else clause in ia_css_pipe_check_format()

Signed-off-by: Martiros Shakhzadyan <vrzh@vrzh.net>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-05-19 09:51:38 +02:00
Martiros Shakhzadyan
dfdd8ceb6f media: staging: media: atomisp: Remove all redundant assertions in sh_css.c
Remove the remainder of assert() in places where the condition is
already handled.

Signed-off-by: Martiros Shakhzadyan <vrzh@vrzh.net>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-05-19 09:51:38 +02:00
Martiros Shakhzadyan
7394bf6d3c media: staging: media: atomisp: Fix the rest of sh_css.c brace issues
Fix the remainder of brace coding style issues.

Signed-off-by: Martiros Shakhzadyan <vrzh@vrzh.net>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-05-19 09:51:38 +02:00
Martiros Shakhzadyan
c0633711b0 media: staging: media: atomisp: Remove redundant assertions in sh_css.c
Remove assert() in places where the condition is already handled.

Signed-off-by: Martiros Shakhzadyan <vrzh@vrzh.net>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-05-19 09:51:38 +02:00
Martiros Shakhzadyan
6ceb557604 media: staging: media: atomisp: Fix sh_css.c brace coding style issues
Fix brace coding style issues.

Signed-off-by: Martiros Shakhzadyan <vrzh@vrzh.net>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-05-19 09:51:38 +02:00
Aline Santana Cordeiro
049eda0749 media: staging: media: tegra-video: Align line break to match with the open parenthesis in file vi.c
Align line break to match with the open parenthesis.
Issue detected by checkpatch.pl.

Signed-off-by: Aline Santana Cordeiro <alinesantanacordeiro@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-05-19 09:51:38 +02:00
Aline Santana Cordeiro
d1ca04c476 media: staging: media: atomisp: pci: Balance braces around conditional statements in file atomisp_v4l2.c
Balance braces around conditional statements.
Issue detected by checkpatch.pl.
It happens in if-else statements where one of the commands
uses braces around a block of code and the other command
does not since it has just a single line of code.

Signed-off-by: Aline Santana Cordeiro <alinesantanacordeiro@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-05-19 09:51:37 +02:00
Aline Santana Cordeiro
41d1f1b039 media: staging: media: atomisp: pci: Balance braces around conditional statements in file atomisp_subdev.c
Balance braces around conditional statements.
Issue detected by checkpatch.pl.
It happens in if-else statements where one of the commands
uses braces around a block of code and the other command
does not since it has just a single line of code.

Signed-off-by: Aline Santana Cordeiro <alinesantanacordeiro@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-05-19 09:51:37 +02:00
Aline Santana Cordeiro
b6465b1d74 media: staging: media: atomisp: pci: Balance braces around conditional statements in file atomisp_compat_css20.c
Balance braces around conditional statements.
Issue detected by checkpatch.pl.
It happens in if-else statements where one of the commands
uses braces around a block of code and the other command
does not since it has just a single line of code.

Signed-off-by: Aline Santana Cordeiro <alinesantanacordeiro@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-05-19 09:51:37 +02:00
Aline Santana Cordeiro
0a016c35a3 media: staging: media: atomisp: pci: Balance braces around conditional statements in file atomisp_cmd.c
Balance braces around conditional statements.
Issue detected by checkpatch.pl.
It happens in if-else statements where one of the commands
uses braces around a block of code and the other command
does not since it has just a single line of code.

Signed-off-by: Aline Santana Cordeiro <alinesantanacordeiro@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-05-19 09:51:37 +02:00
Mauro Carvalho Chehab
56c1f08762 media: sti: fix obj-$(config) targets
The right thing to do is to add a new object to the building
system when a certain config option is selected, and *not*
override them.

So, fix obj-$(config) logic at sti makefiles, using "+=",
instead of ":=".

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-05-18 11:32:03 +02:00
Mauro Carvalho Chehab
29dd19e3ac media: exynos4-is: remove a now unused integer
The usage of pm_runtime_resume_and_get() removed the need of a
temporary integer. So, drop it.

Fixes: 59f96244af ("media: exynos4-is: fix pm_runtime_get_sync() usage count")
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-05-11 17:03:21 +02:00
Aline Santana Cordeiro
73edc4da40 media: staging: media: atomisp: pci: Format comments according to coding-style in file atomisp_cmd.h
Format all comments according to the coding-style.
Issue detected by checkpatch.pl.

Signed-off-by: Aline Santana Cordeiro <alinesantanacordeiro@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-05-10 11:36:35 +02:00
Aline Santana Cordeiro
14bc5eb80b media: staging: media: atomisp: pci: Format comments according to coding-style in file atomisp_acc.c
Format all comments according to the coding-style.
Issue detected by checkpatch.pl.

Signed-off-by: Aline Santana Cordeiro <alinesantanacordeiro@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-05-10 11:36:35 +02:00
Aline Santana Cordeiro
848802da8d media: staging: media: atomisp: pci: Correct identation in block of conditional statements in file atomisp_acc.c
Correct identation in block of conditional statements.
The conditional statement depends on the results of the
macro function "list_for_each_entry()".

Signed-off-by: Aline Santana Cordeiro <alinesantanacordeiro@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-05-10 11:36:35 +02:00
Aline Santana Cordeiro
bbbcba0267 media: staging: media: atomisp: pci: Correct identation in block of conditional statements in file atomisp_v4l2.c
Correct identation in block of conditional statements.
The function "v4l2_device_unregister_subdev()" depends on
the results of the macro function "list_for_each_entry_safe()".

Signed-off-by: Aline Santana Cordeiro <alinesantanacordeiro@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-05-10 11:36:35 +02:00
Aline Santana Cordeiro
d7c89be51d media: staging: media: omap4iss: Remove unused macro function
Remove unused macro function "v4l2_dev_to_iss_device(dev)".

Signed-off-by: Aline Santana Cordeiro <alinesantanacordeiro@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-05-10 11:36:35 +02:00
Martiros Shakhzadyan
451c34dd69 media: staging: media: atomisp: Minor code style changes
Fixed line continuation and parenthesis alignment issues.

Signed-off-by: Martiros Shakhzadyan <vrzh@vrzh.net>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-05-10 11:36:35 +02:00
Mitali Borkar
7900bdc25a media: staging: media: zoran: add spaces around '<<' operator
Added spaces around '<<' operator to improve readability and meet linux
kernel coding style.
Reported by checkpatch

Signed-off-by: Mitali Borkar <mitaliborkar810@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-05-10 11:36:35 +02:00
Mitali Borkar
72e0387241 media: staging: media: intel-ipu3: line should not end with '['
Fixed the issue of line should not end with '[' by moving argument
from next line to line ending with '[' and made it under 80
characters.
Reported by checkpatch.

Signed-off-by: Mitali Borkar <mitaliborkar810@gmail.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-05-10 11:36:35 +02:00
Mitali Borkar
17daf473e2 media: staging: media: intel-ipu3: remove space before tabs
Removed unnecessary space before tabs to adhere to  linux kernel coding
style.
Reported by checkpatch.

Signed-off-by: Mitali Borkar <mitaliborkar810@gmail.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-05-10 11:36:35 +02:00
Mitali Borkar
25074ea239 media: staging: media: intel-ipu3: reduce length of line
Reduced length of line as it was exceeding 100 characters by removing
comments from same line and adding it to previous line. This makes code
neater, and meets linux kernel coding style.
Reported by checkpatch.

Signed-off-by: Mitali Borkar <mitaliborkar810@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-05-10 11:36:34 +02:00
Mitali Borkar
a21baa418c media: staging: media: intel-ipu3: remove unnecessary blank line
Removed an unnecessary blank line to meet linux kernel coding style.
Reported by checkpatch.pl

Signed-off-by: Mitali Borkar <mitaliborkar810@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-05-10 11:36:34 +02:00
Beatriz Martins de Carvalho
94dfa800dd media: staging: media: atomisp: i2c: align line break to match with open parenthesis
Aligns line break with the remaining function arguments
to the open parenthesis.
Issue found by checkpatch in file atomisp-gc2235.c

Signed-off-by: Beatriz Martins de Carvalho <martinsdecarvalhobeatriz@gmail.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-05-10 11:36:34 +02:00
Martiros Shakhzadyan
047d39c4a1 media: staging: media: atomisp: Removed a superfluous else clause
Fixed a coding style issue.

Signed-off-by: Martiros Shakhzadyan <vrzh@vrzh.net>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-05-10 11:36:34 +02:00
Aline Santana Cordeiro
d58f75de9b media: staging: media: omap4iss: Align line break to the open parenthesis in file iss_video.c
Aligns line break with the remaining function arguments
to the open parenthesis. Issue found by checkpatch.

Signed-off-by: Aline Santana Cordeiro <alinesantanacordeiro@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-05-10 11:36:34 +02:00
Aline Santana Cordeiro
d637c5dbbf media: staging: media: hantro: Align line break to the open parenthesis in file hantro_mpeg2.c
Aligns line break with the remaining function arguments
to the open parenthesis. Issue found by checkpatch.

Signed-off-by: Aline Santana Cordeiro <alinesantanacordeiro@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-05-10 11:36:34 +02:00
Aline Santana Cordeiro
9148cded3a media: staging: media: hantro: Align line break to the open parenthesis in file hantro_hw.h
Aligns line break with the remaining function arguments
to the open parenthesis. Issue found by checkpatch.

Signed-off-by: Aline Santana Cordeiro <alinesantanacordeiro@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-05-10 11:36:34 +02:00
Mauro Carvalho Chehab
59087b66ea media: exynos-gsc: fix pm_runtime_get_sync() usage count
The pm_runtime_get_sync() internally increments the
dev->power.usage_count without decrementing it, even on errors.
Replace it by the new pm_runtime_resume_and_get(), introduced by:
commit dd8088d5a8 ("PM: runtime: Add pm_runtime_resume_and_get to deal with usage counter")
in order to properly decrement the usage counter, avoiding
a potential PM usage counter leak.

As a bonus, as pm_runtime_get_sync() always return 0 on
success, the logic can be simplified.

Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-05-10 11:36:34 +02:00
Mauro Carvalho Chehab
59f96244af media: exynos4-is: fix pm_runtime_get_sync() usage count
The pm_runtime_get_sync() internally increments the
dev->power.usage_count without decrementing it, even on errors.

On some places, this is ok, but on others the usage count
ended being unbalanced on failures.

Replace it by the new pm_runtime_resume_and_get(), introduced by:
commit dd8088d5a8 ("PM: runtime: Add pm_runtime_resume_and_get to deal with usage counter")
in order to properly decrement the usage counter, avoiding
a potential PM usage counter leak.

As a bonus, such function always return zero on success. So,
some code can be simplified.

Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-05-10 11:36:34 +02:00
Mauro Carvalho Chehab
c44eac5b72 media: sti/bdisp: fix pm_runtime_get_sync() usage count
The pm_runtime_get_sync() internally increments the
dev->power.usage_count without decrementing it, even on errors.

The bdisp_start_streaming() doesn't take it into account, which
would unbalance PM usage counter at bdisp_stop_streaming().

The logic at bdisp_probe() is correct, but the best is to use
the same call along the driver.

So, replace it by the new pm_runtime_resume_and_get(), introduced by:
commit dd8088d5a8 ("PM: runtime: Add pm_runtime_resume_and_get to deal with usage counter")
in order to properly decrement the usage counter, avoiding
a potential PM usage counter leak.

Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-05-10 11:36:34 +02:00
Mauro Carvalho Chehab
9c298f82d8 media: sunxi: fix pm_runtime_get_sync() usage count
The pm_runtime_get_sync() internally increments the
dev->power.usage_count without decrementing it, even on errors.
Replace it by the new pm_runtime_resume_and_get(), introduced by:
commit dd8088d5a8 ("PM: runtime: Add pm_runtime_resume_and_get to deal with usage counter")
in order to properly decrement the usage counter, avoiding
a potential PM usage counter leak.

Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-05-10 11:36:34 +02:00
Mauro Carvalho Chehab
baa450f08d media: sti/delta: use pm_runtime_resume_and_get()
Commit dd8088d5a8 ("PM: runtime: Add pm_runtime_resume_and_get to deal with usage counter")
added pm_runtime_resume_and_get() in order to automatically handle
dev->power.usage_count decrement on errors.

Use the new API, in order to cleanup the error check logic.

Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-05-10 11:36:34 +02:00