In case of error, the function clk_get() returns ERR_PTR()
and never returns NULL pointer. The NULL test in the error
handling should be replaced with IS_ERR().
dpatch engine is used to auto generated this patch.
(https://github.com/weiyj/dpatch)
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Let's define some things locally to avoid breaking build
when irqs.h is removed.
This is needed for the ARM common zImage support.
Cc: Omar Ramirez Luna <omar.ramirez@ti.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The dereference should be moved below the NULL test.
spatch with a semantic match is used to found this.
(http://coccinelle.lip6.fr/)
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Commit 8cb05f4b54 (staging:
tidspbridge: eliminate uuid_uuid_to_string), not only broke
compilation but also functionality for tidspbridge driver.
So:
- Replace remaining instances of uuid_uuid_to_string with snprintf
to fix compilation.
- Fix the format from %pU to %pUL.
- Since these UUIDs are used in the firmware to reference section
names, the firmware doesn't follow the standard uuid delimiter '-'
it uses '_' instead. The driver can follow the standard convention
however for dsp sections we must transform the uuid to what is
expected by the firmware. E.g.:
tidspbridge sees: 24BC8D90-BB45-11D4-B756-006008BDB66F
firmware expects: .24BC8D90_BB45_11D4_B756_006008BDB66F
Signed-off-by: Omar Ramirez Luna <omar.ramirez@copitl.com>
CC: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
the code under _init and _exit does platform_driver_register and
platform_driver_unregister respectively only,
so its better to use the module_platform_driver than just replicating
the module_platform_driver's implementation
Signed-off-by: Devendra Naga <develkernel412222@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
There is native specificator for snprintf to get UUID in human readable format.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Omar Ramirez Luna <omar.ramirez@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Dynamically allocate my_sym_buf to silence the following warning:
drivers/staging/tidspbridge/dynload/cload.c:
In function 'dload_symbols':
drivers/staging/tidspbridge/dynload/cload.c:890:
warning: the frame size of 1040 bytes is larger than 1024 bytes
Signed-off-by: Omar Ramirez Luna <omar.ramirez@copitl.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Dynamically allocate ibuf to silence the following warning:
drivers/staging/tidspbridge/dynload/cload.c:
In function 'dload_data':
drivers/staging/tidspbridge/dynload/cload.c:1337:
warning: the frame size of 1216 bytes is larger than 1024 bytes
Signed-off-by: Omar Ramirez Luna <omar.ramirez@copitl.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Due to its size, this function declares too many variables,
to split it a new structure has been declared to hold values
as they are read from the baseimage.
While at it, indentation was reduced by renaming variables
and reducing blocks of code with the following structure:
if (success) {
...
if (success)
...
}
This fixes the following warning:
drivers/staging/tidspbridge/core/io_sm.c:
In function 'bridge_io_on_loaded':
drivers/staging/tidspbridge/core/io_sm.c:777:
warning: the frame size of 1032 bytes is larger
than 1024 bytes
Signed-off-by: Omar Ramirez Luna <omar.ramirez@copitl.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
And fix the following warning for passing an incorrect
variable type.
../tiomap3430.c: In function 'user_va2_pa':
../tiomap3430.c:1555:
warning: passing argument 1 of 'pmd_offset' from
incompatible pointer type
arch/arm/include/asm/pgtable-2level.h:156:
note: expected 'struct pud_t *' but argument is of
type 'pmdval_t (*)[2]'
While at it, eliminate 'if' nesting to increase readability.
Signed-off-by: Omar Ramirez Luna <omar.ramirez@copitl.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Instead now use ioremap. This is needed for 3.4 since this change
emerged in mainline during one of the previous rc cycles.
These solves the following compilation breaks:
drivers/staging/tidspbridge/core/tiomap3430.c:
In function ‘bridge_brd_start’:
drivers/staging/tidspbridge/core/tiomap3430.c:425:4:
error: implicit declaration of function ‘OMAP2_L4_IO_ADDRESS’
drivers/staging/tidspbridge/core/wdt.c: In function ‘dsp_wdt_init’:
drivers/staging/tidspbridge/core/wdt.c:56:2:
error: implicit declaration of function ‘OMAP2_L4_IO_ADDRESS’
For control registers a new function needs to be defined so we
can get rid of a layer violation, but that approach must be queued
for the next merge window.
As seen in:
http://www.arm.linux.org.uk/developer/build/
platform: omap4430-sdp build: uImage
config: randconfig version: 3.4.0-rc3
start time: Apr 20 2012 01:07
Reported-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Omar Ramirez Luna <omar.ramirez@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Remove all #inclusions of asm/system.h preparatory to splitting and killing
it. Performed with the following command:
perl -p -i -e 's!^#\s*include\s*<asm/system[.]h>.*\n!!' `grep -Irl '^#\s*include\s*<asm/system[.]h>' *`
Signed-off-by: David Howells <dhowells@redhat.com>
The dynamic loader was called by node.c with an interface. This interface was
also modified to avoid the use of nldr_init() and nldr_exit().
There is not functional changes.
Signed-off-by: Víctor Manuel Jáquez Leal <vjaquez@igalia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The nldr module has a nldr_init() and a nldr_exit() whose only purpose
is to keep a reference counting which is not used at all.
This patch only removes the reference count variable, but not the
functions, because they are used through an interface.
There is no functional changes.
Signed-off-by: Víctor Manuel Jáquez Leal <vjaquez@igalia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The gh module has a gh_init() and a gh_exit(), but they don't do
anything, they are just noops.
This patch removes these functions.
There is no functional changes.
Signed-off-by: Víctor Manuel Jáquez Leal <vjaquez@igalia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The dev module has a dev_init() and a dev_exit() whose only purpose is
to keep a reference counting which is not used at all.
This patch removes these functions and the reference count variable.
There is no functional changes.
Signed-off-by: Víctor Manuel Jáquez Leal <vjaquez@igalia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The dmm module has a dmm_init() and a dmm_exit() whose only purpose is
to keep a reference counting which is not used at all.
This patch removes these functions and the reference count variable.
There is no functional changes.
Signed-off-by: Víctor Manuel Jáquez Leal <vjaquez@igalia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The cmm module has a cmm_init() and a cmm_exit() whose only purpose is
to keep a reference counting which is not used at all.
This patch removes these functions and the reference count variable.
There is no functional changes.
Signed-off-by: Víctor Manuel Jáquez Leal <vjaquez@igalia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The io module has a io_init() and a io_exit() whose only purpose is to
keep a reference counting which is not used at all.
This patch removes these functions and the reference count variable.
There is no functional changes.
Signed-off-by: Víctor Manuel Jáquez Leal <vjaquez@igalia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The msg module has a msg_mod_init() and a msg_exit() whose only
purpose is to keep a reference counting which is not used at all.
This patch removes these functions and the reference count variable.
There is no functional changes.
Signed-off-by: Víctor Manuel Jáquez Leal <vjaquez@igalia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The chnl module has a chnl_init() and a chnl_exit() whose only purpose
is to keep a reference counting which is not used at all.
This patch removes these functions and the reference count variable.
There is no functional changes.
Signed-off-by: Víctor Manuel Jáquez Leal <vjaquez@igalia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The rmm module has a rmm_init() and a rmm_exit() whose only purpose is
to keep a reference counting which is not used at all.
This patch removes these functions and the reference count variable.
There is no functional changes.
Signed-off-by: Víctor Manuel Jáquez Leal <vjaquez@igalia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The strm module has a strm_init() and a strm_exit() whose only purpose
is to keep a reference counting which is not used at all.
This patch removes these functions and the reference count variable.
There is no functional changes.
Signed-off-by: Víctor Manuel Jáquez Leal <vjaquez@igalia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The disp module has a disp_init() and a disp_exit() whose only purpose
is to keep a reference counting which is not used at all.
This patch removes these functions and the reference count variable.
There is no functional changes.
Signed-off-by: Víctor Manuel Jáquez Leal <vjaquez@igalia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The node module has a node_init() and a node_exit() whose only purpose
is to keep a reference counting which is not used at all.
This patch removes these functions and the reference count variable.
There is no functional changes.
Signed-off-by: Víctor Manuel Jáquez Leal <vjaquez@igalia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The proc module has a proc_init() and a proc_exit() whose only purpose
is to keep a reference counting which is not used at all.
This patch removes these functions and the reference count variable.
There is no functional changes.
Signed-off-by: Víctor Manuel Jáquez Leal <vjaquez@igalia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The cod module has a cod_init() and a cod_exit() whose only purpose is
to keep a reference counting which is not used at all.
This patch removes these functions and the reference count variable.
There is no functional changes.
Signed-off-by: Víctor Manuel Jáquez Leal <vjaquez@igalia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The drv module has a drv_init() and a drv_exit() whose only purpose is
to keep a reference counting which is not used at all.
This patch removes these functions and the reference count variable.
There is no functional changes.
Signed-off-by: Víctor Manuel Jáquez Leal <vjaquez@igalia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
In order to detect WDT feature on the dsp code, we need to
find the symbol used to enable it inside the baseimage.
This should fix the warning comming from L3 driver:
WARNING: at arch/arm/mach-omap2/omap_l3_smx.c:161 omap3_l3_app_irq...
In-band Error seen by IVA_SS at address 0
...
That occurs because the dsp tries to access wdt3 registers when the clock
for those registers is not enabled.
Reported-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Omar Ramirez Luna <omar.ramirez@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
In order to detect it at runtime, we need the code handling wdt
clock available at runtime to decide whether to enable or disable
based on the baseimage symbols. Default timeout has been set to 5
seconds.
Downside is that we will lose the option to set a custom timeout
for overflow, but than can be added (if needed) as part of debugfs.
Signed-off-by: Omar Ramirez <omar.ramirez@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
There are two members of pr_ctxt allocated during bridge_open that
are never freed resulting in memory leaks, these are stream_id and
node_id, they are now freed on release of the handle (bridge_release)
right before freeing pr_ctxt.
Error path for bridge_open was also fixed since the same variables
could result in memory leaking due to missing handling of failure
scenarios. While at it, the indentation changes were introduced to
avoid interleaved goto statements inside big if blocks.
Signed-off-by: Omar Ramirez Luna <omar.ramirez@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This was done to resolve some merge issues with the following files that
had changed in both branches:
drivers/staging/rtl8712/rtl871x_sta_mgt.c
drivers/staging/tidspbridge/rmgr/drv_interface.c
drivers/staging/zcache/zcache-main.c
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Since all the asserts and DBC macros are gone, the kconfig macro
CONFIG_TIDSPBRIDGE_DEBUG is not almost used, but for printing trace messages.
Since it is almost not used, I don't see any case for keep it churning the
configuration menu.
This patch removes completely the kconfig macro CONFIG_TIDSPBRIDGE_DEBUG,
using only TIDSPBRIDGE_BACKTRACE for enabling the debug trace messages.
Signed-off-by: Víctor Manuel Jáquez Leal <vjaquez@igalia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
All the macros in dbc.h are removed now so this patch removes it completely.
Signed-off-by: Víctor Manuel Jáquez Leal <vjaquez@igalia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This macro is only valid when CONFIG_TIDSPBRDIGE_DEBUG is enabled and it only
prints a log message, it is not a real assertion mechanism like BUG_ON() or
WARN_ON().
It is better to remove them: less code to maintain.
Signed-off-by: Víctor Manuel Jáquez Leal <vjaquez@igalia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The kernel does not use a "Design by Contract" approach, and it is only
activated in the module if CONFIG_TIDSPBRDIGE_DEBUG is enabled, so they are
executed rarely. It is better to remove them: less code to maintain.
Signed-off-by: Víctor Manuel Jáquez Leal <vjaquez@igalia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
tidspbridge when built as a module is named bridgedriver.
bridgedriver is not a particularly good module name.
tidspbridge is what the source is named. That seems
a more appropriate module name too as it describes
the hardware function better.
Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Omar Ramirez Luna <omar.ramirez@ti.com>
Acked-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The variable offset is not used but in the debug log, so I don't see reason to
calculate it here.
Signed-off-by: Víctor Manuel Jáquez Leal <vjaquez@igalia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The function dsp_deinit() always return true, so assert its output is
pointless. As consequence the variable were the returned value is stored, is
no longer needed.
Signed-off-by: Víctor Manuel Jáquez Leal <vjaquez@igalia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drv_interface.c include several header files that are not really used.
Signed-off-by: Víctor Manuel Jáquez Leal <vjaquez@igalia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
When compiling this report is raised by the compiler:
CC [M] drivers/staging/tidspbridge/rmgr/drv_interface.o
drivers/staging/tidspbridge/rmgr/drv_interface.c: In function 'bridge_mmap':
drivers/staging/tidspbridge/rmgr/drv_interface.c:275:2: warning: format '%lx' expects type 'long unsigned int', but argument 9 has type 'pgprot_t'
This patch fixes that warning message.
Signed-off-by: Víctor Manuel Jáquez Leal <vjaquez@igalia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
No functional changes.
According to Lindent, the file drv_internface.c had some lines with bad
indentation.
This commit is the output of Lindent.
Signed-off-by: Víctor Manuel Jáquez Leal <vjaquez@igalia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
No functional changes.
The header file drv_interface.h was only used locally, hence there's no need
to have it.
Also the only prototyped functions were the file_operations callbacks, then
this commit moves them up to avoid prototyping too.
Signed-off-by: Víctor Manuel Jáquez Leal <vjaquez@igalia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Uppercase function names are not pretty. Also the code flow readability is
enhanced.
Signed-off-by: Víctor Manuel Jáquez Leal <vjaquez@igalia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This structure is still used after it has been freed, since it
is being allocated in probe, calls to free it have been moved to
module's remove routine.
This should fix the follwoing messages when attempting to remove the
module:
drv_get_first_dev_extension: Failed to retrieve the object handle
drv_get_first_dev_extension: Failed to retrieve the object handle
drv_destroy: Failed to store DRV object
mgr_destroy: Failed to store MGR object
Signed-off-by: Omar Ramirez Luna <omar.ramirez@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>