Re: [PATCH 03/16] staging: m57621-mmc: delete driver from the tree.

2019-04-02 Thread Christian Lütke-Stetzkamp
On Wed, Apr 03, 2019 at 06:51:49AM +1100, NeilBrown wrote: > People keep telling me that drivers/mmc/host/mtk-sd.c should be able to > handle the same hardware as this driver, with a little bit of work. > Unfortunately they haven't told me what the little bit of work involves. > > Have you explore

[PATCH 21/34] staging: mt7621-mmc: Remove unused datastructures

2018-04-02 Thread Christian Lütke-Stetzkamp
Remove unused datastructures and comments referring to their former use. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/sd.c | 23 --- 1 file changed, 23 deletions(-) diff --git a/drivers/staging/mt7621-mmc/sd.c b/drivers/staging/mt7621-mmc/sd.c

[PATCH 02/34] staging: mt7621-mmc: Remove whitespace errors in dbg.c

2018-04-02 Thread Christian Lütke-Stetzkamp
The whitespace errors in the file dbg.c are fixed by using the cleanfile script. Indentations with whitespaces are not changed in this patch. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/dbg.c | 190 +++ 1 file changed, 95

[PATCH 30/34] staging: mt7621-mmc: Fix different caps for different devices

2018-04-02 Thread Christian Lütke-Stetzkamp
Current code saves the need for polling in a global variable, that leeds to problems, when the driver should handle multiple devices with different capabilities. By looking up the capability in the mmc_host capabilities, they now have per device scope. Signed-off-by: Christian Lütke-Stetzkamp

[PATCH 15/34] staging: mt7621-mmc: Remove global initialise to 0

2018-04-02 Thread Christian Lütke-Stetzkamp
Fix checkpatch error: GLOBAL_INITIALISERS Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/dbg.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/mt7621-mmc/dbg.c b/drivers/staging/mt7621-mmc/dbg.c index 60c704d6adc2..1e4c95b659da

[PATCH 05/34] staging: mt7621-mmc: Remove whitespace errors in sd.c

2018-04-02 Thread Christian Lütke-Stetzkamp
The whitespace errors in the file sd.c are fixed by using the cleanfile script. Indentations with whitespaces are not changed in this patch. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/sd.c | 1142 +++ 1 file changed, 571

[PATCH 31/34] staging: mt7621-mmc: Remove dead codepath from probe function

2018-04-02 Thread Christian Lütke-Stetzkamp
The probe function contains lots of code, that is never used, because the fields it checks for in the msdc_hw structure are never initialized. Removing them should be safe. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/sd.c | 20 1 file changed, 20

[PATCH 00/34] staging: mt7621-mmc: First cleanups

2018-04-02 Thread Christian Lütke-Stetzkamp
This patch series does the first cleanups in this driver. At some points I already tried to get the code of this driver as near as possible to the mk-sd driver in mainline. Christian Lütke-Stetzkamp (34): staging: mt7621-mmc: Remove whitespace errors in board.h staging: mt7621-mmc: Remove

[PATCH 29/34] staging: mt7621-mmc: Remove unnecessary field from struct msdc_hw

2018-04-02 Thread Christian Lütke-Stetzkamp
Remove the unnecessary field data_pins from msdc_hw, later this information should be taken from the device tree. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/board.h | 1 - drivers/staging/mt7621-mmc/sd.c| 10 -- 2 files changed, 4 insertions(+), 7

[PATCH 04/34] staging: mt7621-mmc: Remove whitespace errors in mt6575_sd.h

2018-04-02 Thread Christian Lütke-Stetzkamp
The whitespace errors in the file mt6575_sd.h are fixed by using the cleanfile script. Indentations with whitespaces are not changed in this patch. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/mt6575_sd.h | 49 +- 1 file changed, 24

[PATCH 09/34] staging: mt7621-mmc: Fix indent for mt6575_sd.h

2018-04-02 Thread Christian Lütke-Stetzkamp
This fixes the indentaions in the file mt7621_sd.h Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/mt6575_sd.h | 820 - 1 file changed, 410 insertions(+), 410 deletions(-) diff --git a/drivers/staging/mt7621-mmc/mt6575_sd.h b/drivers

[PATCH 03/34] staging: mt7621-mmc: Remove whitespace errors in dbg.h

2018-04-02 Thread Christian Lütke-Stetzkamp
The whitespace errors in the file dbg.h are fixed by using the cleanfile script. Indentations with whitespaces are not changed in this patch. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/dbg.h | 38 +++--- 1 file changed, 19 insertions

[PATCH 33/34] staging: mt7621-mmc: Fix requesting of irq

2018-04-02 Thread Christian Lütke-Stetzkamp
The request of the irq line is not correctly handled by the current code, platform_get_irq may fail and if the irq is requested via devm_request_irq, its release is automatically done. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/sd.c | 29

[PATCH 19/34] staging: mt7621-mmc: Remove code guarded by nonexistent config option

2018-04-02 Thread Christian Lütke-Stetzkamp
Remove a piece of code that is guarded by a config option, that is nonexistent, the function it calls is also nonexistent. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/sd.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/drivers/staging/mt7621-mmc/sd.c b

[PATCH 18/34] staging: mt7621-mmc: Replace seq_printf with seq_puts where possible

2018-04-02 Thread Christian Lütke-Stetzkamp
Replace seq_printf with seq_puts when the string is const. Fix checkpatch warning: PREFER_SEQ_PUTS Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/dbg.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/staging/mt7621-mmc

[PATCH 08/34] staging: mt7621-mmc: Fix indent for dbg.h

2018-04-02 Thread Christian Lütke-Stetzkamp
This fixes the indentaions in the file dbg.h Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/dbg.h | 60 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/drivers/staging/mt7621-mmc/dbg.h b/drivers/staging/mt7621-mmc

[PATCH 34/34] staging: mt7621-mmc: Remove duplicate defines

2018-04-02 Thread Christian Lütke-Stetzkamp
Remove defines that are both in board.h and sd.c from sd.c, this file already includes board.h Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/sd.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/drivers/staging/mt7621-mmc/sd.c b/drivers/staging/mt7621-mmc/sd.c

[PATCH 25/34] staging: mt7621-mmc: Remove code checking for old kernel versions

2018-04-02 Thread Christian Lütke-Stetzkamp
Remove code, that is checking for old kernel versions, leaving only the case for current versions. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/sd.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/staging/mt7621-mmc/sd.c b/drivers

[PATCH 12/34] staging: mt7621-mmc: Fix Pointer Location

2018-04-02 Thread Christian Lütke-Stetzkamp
Fix checkpatch error: POINTER_LOCATION Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/board.h | 2 +- drivers/staging/mt7621-mmc/dbg.c | 8 +++--- drivers/staging/mt7621-mmc/sd.c| 56 +++--- 3 files changed, 33 insertions(+), 33

[PATCH 16/34] staging: mt7621-mmc: Fix style of braces

2018-04-02 Thread Christian Lütke-Stetzkamp
Fix checkpatch errors, warnings, checks about braces: BRACES, ELSE_AFTER_BRACE, OPEN_BRACE Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/dbg.c | 31 +++ drivers/staging/mt7621-mmc/mt6575_sd.h | 3 +- drivers/staging/mt7621-mmc/sd.c| 154

[PATCH 20/34] staging: mt7621-mmc: Remove code for different soc types

2018-04-02 Thread Christian Lütke-Stetzkamp
: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/sd.c | 25 - 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/drivers/staging/mt7621-mmc/sd.c b/drivers/staging/mt7621-mmc/sd.c index e28635ab556a..552bf0824d31 100644 --- a/drivers/staging/mt7621-mmc/sd.c

[PATCH 22/34] staging: mt7621-mmc: Cleanup function mt_msdc_init

2018-04-02 Thread Christian Lütke-Stetzkamp
Cleanup the mt_msdc_init function, remove excceding printk. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/sd.c | 4 1 file changed, 4 deletions(-) diff --git a/drivers/staging/mt7621-mmc/sd.c b/drivers/staging/mt7621-mmc/sd.c index 7cc7aa4b6ec7..4fe378040ce3

[PATCH 06/34] staging: mt7621-mmc: Fix indent for dbg.c

2018-04-02 Thread Christian Lütke-Stetzkamp
This fixes the indentaions in the file dbg.c Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/dbg.c | 258 +++ 1 file changed, 129 insertions(+), 129 deletions(-) diff --git a/drivers/staging/mt7621-mmc/dbg.c b/drivers/staging/mt7621

[PATCH 14/34] staging: mt7621-mmc: Fix trailing statements

2018-04-02 Thread Christian Lütke-Stetzkamp
Fix checkpatch error: TRAILING_STATEMENTS Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/dbg.c | 25 ++--- drivers/staging/mt7621-mmc/dbg.h | 3 ++- drivers/staging/mt7621-mmc/sd.c | 39 ++- 3 files changed, 46

[PATCH 32/34] staging: mt7621-mmc: Fix dma_alloc_coherent should get device as first param

2018-04-02 Thread Christian Lütke-Stetzkamp
The dma_alloc_coherent (and also dma_free_coherent) should get the device, the dma memory is allocated for as the first parameter. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/sd.c | 18 -- 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a

[PATCH 01/34] staging: mt7621-mmc: Remove whitespace errors in board.h

2018-04-02 Thread Christian Lütke-Stetzkamp
The whitespace errors in the file board.h are fixed by using the cleanfile script. Indentations with whitespaces are not changed in this patch. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/board.h | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff

[PATCH 24/34] staging: mt7621-mmc: Fix memory leek in case of error in probe

2018-04-02 Thread Christian Lütke-Stetzkamp
If the base address is not successfully obtained in the probe function, then the mmc_host struct is not freed. Adding an exit for that case fixes the bug. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/sd.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions

[PATCH 28/34] staging: mt7621-mmc: Remove unnecessary setting of dev.platform_data

2018-04-02 Thread Christian Lütke-Stetzkamp
In the probe function, pdev->dev.platform_data is set to &msdc0_hw, but the only get access to that is also in the probe function. So that assignment is removed. The msdc0_hw structure is still available to the driver as part of the msdc_host structure. Signed-off-by: Christian Lütke-St

[PATCH 13/34] staging: mt7621-mmc: Remove unnecessary typedefs

2018-04-02 Thread Christian Lütke-Stetzkamp
Fixes checkpatch warning: NEW_TYPEDEFS Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/dbg.c | 2 +- drivers/staging/mt7621-mmc/dbg.h | 11 +- drivers/staging/mt7621-mmc/mt6575_sd.h | 305 +++-- drivers/staging/mt7621-mmc/sd.c

[PATCH 26/34] staging: mt7621-mmc: Fix unmatched release_mem_regin

2018-04-02 Thread Christian Lütke-Stetzkamp
Current code calls release_mem_regin on driver remove without requesting it explicit first. The region is only requested via devm_ioremap_resource and that releases it automatically. Removing the release_mem_region calls fixes this. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging

[PATCH 11/34] staging: mt7621-mmc: Fix spacing

2018-04-02 Thread Christian Lütke-Stetzkamp
Fixes checkpatch errors, warnings, checks: SPACING, LEADING_SPACE, LINE_SPACING Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/board.h | 3 +- drivers/staging/mt7621-mmc/dbg.c | 67 - drivers/staging/mt7621-mmc/dbg.h | 16 +-- drivers/staging

[PATCH 23/34] staging: mt7621-mmc: Refactor suspend, resume

2018-04-02 Thread Christian Lütke-Stetzkamp
Refactor msdc_drv_{suspend, resume} by adding a new function msdc_drv_pm, that cleans up the code and removes double code. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/sd.c | 26 +++--- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git

[PATCH 07/34] staging: mt7621-mmc: Fix indent for board.h

2018-04-02 Thread Christian Lütke-Stetzkamp
This fixes the indentaions in the file board.h Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/board.h | 68 +++--- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/drivers/staging/mt7621-mmc/board.h b/drivers/staging

[PATCH 17/34] staging: mt7621-mmc: Remove redundant driver owner assignment

2018-04-02 Thread Christian Lütke-Stetzkamp
Remove the owner assignment form the platform driver as platform_driver_register() already initializes the owner. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/sd.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/mt7621-mmc/sd.c b/drivers/staging

[PATCH 27/34] staging: mt7621-mmc: Fix bug on dma_alloc_coherent fail

2018-04-02 Thread Christian Lütke-Stetzkamp
In case of dma_alloc_coherent failing the current code just called BUG_ON. By adding error handling for that case this can be avoided. This also fixes a memory leek in case of a fail later on in the probe function. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/sd.c

Re: [PATCH 00/34] staging: mt7621-mmc: First cleanups

2018-04-03 Thread Christian Lütke-Stetzkamp
On Tue, Apr 03, 2018 at 05:58:31PM +1000, NeilBrown wrote: > Thanks for these. > When I addressed the various problems that I've mentioned separately > the code compiles and boots and can access the sd card! Thanks for your and Dan's quick reviews! Dan, I have tried your script, it makes the proce

[PATCH v2 30/34] staging: mt7621-mmc: Fix different caps for different devices

2018-04-04 Thread Christian Lütke-Stetzkamp
Current code saves the need for polling in a global variable, that leeds to problems, when the driver should handle multiple devices with different capabilities. By looking up the capability in the mmc_host capabilities, they now have per device scope. Signed-off-by: Christian Lütke-Stetzkamp

[PATCH v2 15/34] staging: mt7621-mmc: Remove global initialise to 0

2018-04-04 Thread Christian Lütke-Stetzkamp
Fix checkpatch error: GLOBAL_INITIALISERS Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/dbg.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/mt7621-mmc/dbg.c b/drivers/staging/mt7621-mmc/dbg.c index 60c704d6adc2..1e4c95b659da

[PATCH v2 25/34] staging: mt7621-mmc: Remove code checking for old kernel versions

2018-04-04 Thread Christian Lütke-Stetzkamp
Remove code, that is checking for old kernel versions, leaving only the case for current versions. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/sd.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/staging/mt7621-mmc/sd.c b/drivers

[PATCH v2 19/34] staging: mt7621-mmc: Remove code guarded by nonexistent config option

2018-04-04 Thread Christian Lütke-Stetzkamp
Remove a piece of code that is guarded by a config option, that is nonexistent, the function it calls is also nonexistent. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/sd.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/drivers/staging/mt7621-mmc/sd.c b

[PATCH v2 21/34] staging: mt7621-mmc: Remove unused datastructures

2018-04-04 Thread Christian Lütke-Stetzkamp
Remove unused datastructures and comments referring to their former use. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/sd.c | 23 --- 1 file changed, 23 deletions(-) diff --git a/drivers/staging/mt7621-mmc/sd.c b/drivers/staging/mt7621-mmc/sd.c

[PATCH v2 06/34] staging: mt7621-mmc: Fix indent for dbg.c

2018-04-04 Thread Christian Lütke-Stetzkamp
This fixes the indentaions in the file dbg.c Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/dbg.c | 258 +++ 1 file changed, 129 insertions(+), 129 deletions(-) diff --git a/drivers/staging/mt7621-mmc/dbg.c b/drivers/staging/mt7621

[PATCH v2 29/34] staging: mt7621-mmc: Remove unnecessary field from struct msdc_hw

2018-04-04 Thread Christian Lütke-Stetzkamp
Remove the unnecessary field data_pins from msdc_hw, later this information should be taken from the device tree. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/board.h | 1 - drivers/staging/mt7621-mmc/sd.c| 10 -- 2 files changed, 4 insertions(+), 7

[PATCH v2 04/34] staging: mt7621-mmc: Remove whitespace errors in mt6575_sd.h

2018-04-04 Thread Christian Lütke-Stetzkamp
The whitespace errors in the file mt6575_sd.h are fixed by using the cleanfile script. Indentations with whitespaces are not changed in this patch. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/mt6575_sd.h | 49 +- 1 file changed, 24

[PATCH v2 16/34] staging: mt7621-mmc: Fix style of braces

2018-04-04 Thread Christian Lütke-Stetzkamp
Fix checkpatch errors, warnings, checks about braces: BRACES, ELSE_AFTER_BRACE, OPEN_BRACE Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/dbg.c | 31 +++ drivers/staging/mt7621-mmc/mt6575_sd.h | 3 +- drivers/staging/mt7621-mmc/sd.c| 154

[PATCH v2 09/34] staging: mt7621-mmc: Fix indent for mt6575_sd.h

2018-04-04 Thread Christian Lütke-Stetzkamp
This fixes the indentaions in the file mt7621_sd.h Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/mt6575_sd.h | 820 - 1 file changed, 410 insertions(+), 410 deletions(-) diff --git a/drivers/staging/mt7621-mmc/mt6575_sd.h b/drivers

[PATCH v2 05/34] staging: mt7621-mmc: Remove whitespace errors in sd.c

2018-04-04 Thread Christian Lütke-Stetzkamp
The whitespace errors in the file sd.c are fixed by using the cleanfile script. Indentations with whitespaces are not changed in this patch. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/sd.c | 1142 +++ 1 file changed, 571

[PATCH v2 20/34] staging: mt7621-mmc: Remove code for different soc types

2018-04-04 Thread Christian Lütke-Stetzkamp
: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/sd.c | 25 - 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/drivers/staging/mt7621-mmc/sd.c b/drivers/staging/mt7621-mmc/sd.c index 518ede67b427..6f57d92b564b 100644 --- a/drivers/staging/mt7621-mmc/sd.c

[PATCH v2 13/34] staging: mt7621-mmc: Remove unnecessary typedefs

2018-04-04 Thread Christian Lütke-Stetzkamp
Fixes checkpatch warning: NEW_TYPEDEFS Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/dbg.c | 2 +- drivers/staging/mt7621-mmc/dbg.h | 11 +- drivers/staging/mt7621-mmc/mt6575_sd.h | 305 +++-- drivers/staging/mt7621-mmc/sd.c

[PATCH v2 26/34] staging: mt7621-mmc: Fix unmatched release_mem_regin

2018-04-04 Thread Christian Lütke-Stetzkamp
Current code calls release_mem_regin on driver remove without requesting it explicit first. The region is only requested via devm_ioremap_resource and that releases it automatically. Removing the release_mem_region calls fixes this. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging

[PATCH v2 11/34] staging: mt7621-mmc: Fix spacing

2018-04-04 Thread Christian Lütke-Stetzkamp
Fixes checkpatch errors, warnings, checks: SPACING, LEADING_SPACE, LINE_SPACING Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/board.h | 3 +- drivers/staging/mt7621-mmc/dbg.c | 67 - drivers/staging/mt7621-mmc/dbg.h | 16 +-- drivers/staging

[PATCH v2 07/34] staging: mt7621-mmc: Fix indent for board.h

2018-04-04 Thread Christian Lütke-Stetzkamp
This fixes the indentaions in the file board.h Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/board.h | 68 +++--- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/drivers/staging/mt7621-mmc/board.h b/drivers/staging

[PATCH v2 34/34] staging: mt7621-mmc: Remove duplicate defines

2018-04-04 Thread Christian Lütke-Stetzkamp
Remove defines that are both in board.h and sd.c from sd.c, this file already includes board.h Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/sd.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/drivers/staging/mt7621-mmc/sd.c b/drivers/staging/mt7621-mmc/sd.c

[PATCH v2 23/34] staging: mt7621-mmc: Refactor suspend, resume

2018-04-04 Thread Christian Lütke-Stetzkamp
Refactor msdc_drv_{suspend, resume} by adding a new function msdc_drv_pm, that cleans up the code and removes double code. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/sd.c | 26 +++--- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git

[PATCH v2 17/34] staging: mt7621-mmc: Remove redundant driver owner assignment

2018-04-04 Thread Christian Lütke-Stetzkamp
Remove the owner assignment form the platform driver as platform_driver_register() already initializes the owner. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/sd.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/mt7621-mmc/sd.c b/drivers/staging

[PATCH v2 32/34] staging: mt7621-mmc: Fix dma_alloc_coherent should get device as first param

2018-04-04 Thread Christian Lütke-Stetzkamp
The dma_alloc_coherent (and also dma_free_coherent) should get the device, the dma memory is allocated for as the first parameter. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/sd.c | 18 -- 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a

[PATCH v2 31/34] staging: mt7621-mmc: Remove dead codepath from probe function

2018-04-04 Thread Christian Lütke-Stetzkamp
The probe function contains lots of code, that is never used, because the fields it checks for in the msdc_hw structure are never initialized. Removing them should be safe. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/sd.c | 20 1 file changed, 20

[PATCH v2 00/34] staging: mt7621-mmc: First cleanups

2018-04-04 Thread Christian Lütke-Stetzkamp
This patch series does the first cleanups in this driver. At some points I already tried to get the code of this driver as near as possible to the mk-sd driver in mainline. Changes in v2: * fix typos * Clearify comment regarding request irq Christian Lütke-Stetzkamp (34): staging: mt7621-mmc

[PATCH v2 27/34] staging: mt7621-mmc: Fix bug on dma_alloc_coherent fail

2018-04-04 Thread Christian Lütke-Stetzkamp
In case of dma_alloc_coherent failing the current code just called BUG_ON. By adding error handling for that case this can be avoided. This also fixes a memory leek in case of a fail later on in the probe function. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/sd.c

[PATCH v2 12/34] staging: mt7621-mmc: Fix Pointer Location

2018-04-04 Thread Christian Lütke-Stetzkamp
Fix checkpatch error: POINTER_LOCATION Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/board.h | 2 +- drivers/staging/mt7621-mmc/dbg.c | 8 +++--- drivers/staging/mt7621-mmc/sd.c| 56 +++--- 3 files changed, 33 insertions(+), 33

[PATCH v2 02/34] staging: mt7621-mmc: Remove whitespace errors in dbg.c

2018-04-04 Thread Christian Lütke-Stetzkamp
The whitespace errors in the file dbg.c are fixed by using the cleanfile script. Indentations with whitespaces are not changed in this patch. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/dbg.c | 190 +++ 1 file changed, 95

[PATCH v2 18/34] staging: mt7621-mmc: Replace seq_printf with seq_puts where possible

2018-04-04 Thread Christian Lütke-Stetzkamp
Replace seq_printf with seq_puts when the string is const. Fix checkpatch warning: PREFER_SEQ_PUTS Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/dbg.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/staging/mt7621-mmc

[PATCH v2 24/34] staging: mt7621-mmc: Fix memory leek in case of error in probe

2018-04-04 Thread Christian Lütke-Stetzkamp
If the base address is not successfully obtained in the probe function, then the mmc_host struct is not freed. Adding an exit for that case fixes the bug. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/sd.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions

[PATCH v2 28/34] staging: mt7621-mmc: Remove unnecessary setting of dev.platform_data

2018-04-04 Thread Christian Lütke-Stetzkamp
In the probe function, pdev->dev.platform_data is set to &msdc0_hw, but the only get access to that is also in the probe function. So that assignment is removed. The msdc0_hw structure is still available to the driver as part of the msdc_host structure. Signed-off-by: Christian Lütke-St

[PATCH v2 33/34] staging: mt7621-mmc: Fix requesting of irq

2018-04-04 Thread Christian Lütke-Stetzkamp
The request of the irq line is not correctly handled by the current code, platform_get_irq may fail and if the irq is requested via devm_request_irq, its release is automatically done. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/sd.c | 34

[PATCH v2 01/34] staging: mt7621-mmc: Remove whitespace errors in board.h

2018-04-04 Thread Christian Lütke-Stetzkamp
The whitespace errors in the file board.h are fixed by using the cleanfile script. Indentations with whitespaces are not changed in this patch. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/board.h | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff

[PATCH v2 08/34] staging: mt7621-mmc: Fix indent for dbg.h

2018-04-04 Thread Christian Lütke-Stetzkamp
This fixes the indentaions in the file dbg.h Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/dbg.h | 60 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/drivers/staging/mt7621-mmc/dbg.h b/drivers/staging/mt7621-mmc

[PATCH v2 22/34] staging: mt7621-mmc: Cleanup function mt_msdc_init

2018-04-04 Thread Christian Lütke-Stetzkamp
Cleanup the mt_msdc_init function, remove excceding printk. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/sd.c | 4 1 file changed, 4 deletions(-) diff --git a/drivers/staging/mt7621-mmc/sd.c b/drivers/staging/mt7621-mmc/sd.c index 1d689657e7b1..d7869b665255

[PATCH v2 03/34] staging: mt7621-mmc: Remove whitespace errors in dbg.h

2018-04-04 Thread Christian Lütke-Stetzkamp
The whitespace errors in the file dbg.h are fixed by using the cleanfile script. Indentations with whitespaces are not changed in this patch. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/dbg.h | 38 +++--- 1 file changed, 19 insertions

[PATCH v2 14/34] staging: mt7621-mmc: Fix trailing statements

2018-04-04 Thread Christian Lütke-Stetzkamp
Fix checkpatch error: TRAILING_STATEMENTS Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/dbg.c | 25 ++--- drivers/staging/mt7621-mmc/dbg.h | 3 ++- drivers/staging/mt7621-mmc/sd.c | 39 ++- 3 files changed, 46

Re: [PATCH v2 00/34] staging: mt7621-mmc: First cleanups

2018-04-04 Thread Christian Lütke-Stetzkamp
On Thu, Apr 05, 2018 at 08:06:47AM +1000, NeilBrown wrote: > On Wed, Apr 04 2018, Christian Lütke-Stetzkamp wrote: > > > This patch series does the first cleanups in this driver. At some > > points I already tried to get the code of this driver as near as > > possibl

Re: [bug report] staging: mt7621-mmc: MIPS: ralink: add sdhci for mt7620a SoC

2018-04-05 Thread Christian Lütke-Stetzkamp
On Thu, Apr 05, 2018 at 03:13:10PM +0300, Dan Carpenter wrote: > [ I just decided to forward you guys all the Smatch warnings. -dan ] > > Hello John Crispin, > > The patch 8b634a9c7620: "staging: mt7621-mmc: MIPS: ralink: add sdhci > for mt7620a SoC" from Mar 15, 2018, leads to the following sta

Re: [bug report] staging: mt7621-mmc: MIPS: ralink: add sdhci for mt7620a SoC

2018-04-05 Thread Christian Lütke-Stetzkamp
On Thu, Apr 05, 2018 at 02:56:54PM +0300, Dan Carpenter wrote: > Hello John Crispin, > > The patch 8b634a9c7620: "staging: mt7621-mmc: MIPS: ralink: add sdhci > for mt7620a SoC" from Mar 15, 2018, leads to the following static > checker warning: > > drivers/staging/mt7621-mmc/sd.c:2790 msdc

[PATCH 06/10] staging: mt7621-mmc: Fix dereference before check in msdc_drv_pm

2018-04-06 Thread Christian Lütke-Stetzkamp
In the msdc_drv_pm function the variable mmc is dereferenced before checked. Reordering fixes that. Reported-by: Dan Carpenter Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/sd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging

[PATCH 05/10] staging: mt7621-mmc: Remove constant flag MSDC_HIGHSPEED

2018-04-06 Thread Christian Lütke-Stetzkamp
The MSDC_HIGHSPEED flag is always set and never unset, remove it to clean up the code. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/board.h | 1 - drivers/staging/mt7621-mmc/sd.c| 7 ++- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers

[PATCH 08/10] staging: mt7621-mmc: Fix debug file world writable

2018-04-06 Thread Christian Lütke-Stetzkamp
Currently the debug file in proc fs is world writable, remove the access for other. Reported-by: Dan Carpenter Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/dbg.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/mt7621-mmc/dbg.c b

[PATCH 10/10] staging: mt7621-mmc: Remove redundant opcode check

2018-04-06 Thread Christian Lütke-Stetzkamp
The opcode check in msdc_command_start is redundant in case of MMC_SET_RELATIVE_ADDR, this is 3 like SD_SEND_RELATIVE_ADDR, so the second check can be removed. Reported-by: Dan Carpenter Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/sd.c | 2 +- 1 file changed, 1

[PATCH 01/10] staging: mt7621-mmc: Fix power management by removing old api

2018-04-06 Thread Christian Lütke-Stetzkamp
ted mmc_suspend|resume_host APIs") [3] commit 1e63d4854202 ("mmc: au1xmmc: Move away from using deprecated APIs") Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/sd.c | 14 -- 1 file changed, 14 deletions(-) diff --git a/drivers/staging/mt7

[PATCH 09/10] staging: mt7621-mmc: Fix: copy_from_user() returns a positive value

2018-04-06 Thread Christian Lütke-Stetzkamp
copy_from_user() returns a positive value in case of an error, to fix this the check is turned around, also a better return value is chosen. Reported-by: Dan Carpenter Suggested-by: Dan Carpenter Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/dbg.c | 5 ++--- 1 file

[PATCH 07/10] staging: mt7621-mmc: Remove error message in debug

2018-04-06 Thread Christian Lütke-Stetzkamp
If the debug file in proc fs is not successfully created current code prints an error message, this is removed. Reported-by: Dan Carpenter Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/dbg.c | 4 1 file changed, 4 deletions(-) diff --git a/drivers/staging/mt7621

[PATCH 00/10] staging: mt7621-mmc: Fixes and cleanups

2018-04-06 Thread Christian Lütke-Stetzkamp
Again, here are some fixes (most of them reported by Dan Carpenter) and some removements of unused code in the mt7621-mmc driver. With this patches, the driver at least compiles while CONFIG_PM is selected, but it remains untested. Christian Lütke-Stetzkamp (10): staging: mt7621-mmc: Fix power

[PATCH 04/10] staging: mt7621-mmc: Remove unused functions

2018-04-06 Thread Christian Lütke-Stetzkamp
) ^~~~ drivers/staging/mt7621-mmc/sd.c:507:13: warning: ‘msdc_eirq_sdio’ defined but not used [-Wunused-function] static void msdc_eirq_sdio(void *data) Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/sd.c | 24 1 file changed, 24 deletions

[PATCH 02/10] staging: mt7621-mmc: Remove constant flag

2018-04-06 Thread Christian Lütke-Stetzkamp
The MSDC_SYS_SUSPEND flag is always set and is never unset. Removing it cleans up the code. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/board.h | 1 - drivers/staging/mt7621-mmc/sd.c| 8 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a

[PATCH 03/10] staging: mt7621-mmc: Remove unused global: msdc_6575_host

2018-04-06 Thread Christian Lütke-Stetzkamp
The mt6575_host variable is never used, only set and exported. Removing it for code cleanup. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/sd.c | 5 - 1 file changed, 5 deletions(-) diff --git a/drivers/staging/mt7621-mmc/sd.c b/drivers/staging/mt7621-mmc/sd.c

Re: [PATCH 07/10] staging: mt7621-mmc: Remove error message in debug

2018-04-06 Thread Christian Lütke-Stetzkamp
On Fri, Apr 06, 2018 at 11:51:24AM +0300, Dan Carpenter wrote: > On Fri, Apr 06, 2018 at 10:36:57AM +0200, Christian Lütke-Stetzkamp wrote: > > If the debug file in proc fs is not successfully created current code > > prints an error message, this is removed. > > > >

[PATCH v2 00/10] staging: mt7621-mmc: Fixes and cleanups

2018-04-07 Thread Christian Lütke-Stetzkamp
msdc_debug_proc_init; * Added Reviewed-by tags. Christian Lütke-Stetzkamp (10): staging: mt7621-mmc: Fix power management by removing old api staging: mt7621-mmc: Remove constant flag staging: mt7621-mmc: Remove unused global: msdc_6575_host staging: mt7621-mmc: Remove unused functions staging

[PATCH v2 01/10] staging: mt7621-mmc: Fix power management by removing old api

2018-04-07 Thread Christian Lütke-Stetzkamp
ted mmc_suspend|resume_host APIs") [3] commit 1e63d4854202 ("mmc: au1xmmc: Move away from using deprecated APIs") Signed-off-by: Christian Lütke-Stetzkamp Reviewed-by: NeilBrown --- drivers/staging/mt7621-mmc/sd.c | 14 -- 1 file changed, 14 deletions(-) diff --git a/d

[PATCH v2 05/10] staging: mt7621-mmc: Remove constant flag MSDC_HIGHSPEED

2018-04-07 Thread Christian Lütke-Stetzkamp
The MSDC_HIGHSPEED flag is always set and never unset, remove it to clean up the code. Signed-off-by: Christian Lütke-Stetzkamp Reviewed-by: NeilBrown --- drivers/staging/mt7621-mmc/board.h | 1 - drivers/staging/mt7621-mmc/sd.c| 7 ++- 2 files changed, 2 insertions(+), 6 deletions

[PATCH v2 03/10] staging: mt7621-mmc: Remove unused global: msdc_6575_host

2018-04-07 Thread Christian Lütke-Stetzkamp
The mt6575_host variable is never used, only set and exported. Removing it for code cleanup. Signed-off-by: Christian Lütke-Stetzkamp Reviewed-by: NeilBrown --- drivers/staging/mt7621-mmc/sd.c | 5 - 1 file changed, 5 deletions(-) diff --git a/drivers/staging/mt7621-mmc/sd.c b/drivers

[PATCH v2 10/10] staging: mt7621-mmc: Remove redundant opcode check

2018-04-07 Thread Christian Lütke-Stetzkamp
The opcode check in msdc_command_start is redundant in case of MMC_SET_RELATIVE_ADDR, this is 3 like SD_SEND_RELATIVE_ADDR, so the second check can be removed. Reported-by: Dan Carpenter Signed-off-by: Christian Lütke-Stetzkamp Reviewed-by: NeilBrown --- drivers/staging/mt7621-mmc/sd.c | 2

[PATCH v2 06/10] staging: mt7621-mmc: Fix dereference before check in msdc_drv_pm

2018-04-07 Thread Christian Lütke-Stetzkamp
In the msdc_drv_pm function the variable mmc is dereferenced before checked. Reordering fixes that. Reported-by: Dan Carpenter Signed-off-by: Christian Lütke-Stetzkamp Reviewed-by: NeilBrown --- drivers/staging/mt7621-mmc/sd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff

[PATCH v2 02/10] staging: mt7621-mmc: Remove constant flag

2018-04-07 Thread Christian Lütke-Stetzkamp
The MSDC_SYS_SUSPEND flag is always set and is never unset. Removing it cleans up the code. Signed-off-by: Christian Lütke-Stetzkamp Reviewed-by: NeilBrown --- drivers/staging/mt7621-mmc/board.h | 1 - drivers/staging/mt7621-mmc/sd.c| 8 2 files changed, 4 insertions(+), 5

[PATCH v2 09/10] staging: mt7621-mmc: Fix: copy_from_user() returns a positive value

2018-04-07 Thread Christian Lütke-Stetzkamp
copy_from_user() returns a positive value in case of an error, to fix this the check is turned around, also a better return value is chosen. Reported-by: Dan Carpenter Suggested-by: Dan Carpenter Signed-off-by: Christian Lütke-Stetzkamp Reviewed-by: NeilBrown --- drivers/staging/mt7621-mmc

[PATCH v2 07/10] staging: mt7621-mmc: Remove error message in debug

2018-04-07 Thread Christian Lütke-Stetzkamp
Carpenter Signed-off-by: Christian Lütke-Stetzkamp Reviewed-by: NeilBrown --- drivers/staging/mt7621-mmc/dbg.c | 9 ++--- drivers/staging/mt7621-mmc/dbg.h | 2 +- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/staging/mt7621-mmc/dbg.c b/drivers/staging/mt7621-mmc/dbg.c

[PATCH v2 04/10] staging: mt7621-mmc: Remove unused functions

2018-04-07 Thread Christian Lütke-Stetzkamp
) ^~~~ drivers/staging/mt7621-mmc/sd.c:507:13: warning: ‘msdc_eirq_sdio’ defined but not used [-Wunused-function] static void msdc_eirq_sdio(void *data) Signed-off-by: Christian Lütke-Stetzkamp Reviewed-by: NeilBrown --- drivers/staging/mt7621-mmc/sd.c | 24 1 file

[PATCH v2 08/10] staging: mt7621-mmc: Fix debug file world writable

2018-04-07 Thread Christian Lütke-Stetzkamp
Currently the debug file in proc fs is world writable, remove the access for other. Reported-by: Dan Carpenter Signed-off-by: Christian Lütke-Stetzkamp Reviewed-by: NeilBrown --- drivers/staging/mt7621-mmc/dbg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers

[PATCH 10/31] staging: mt7621-mmc: Remove unused field data_offset from msdc_hw

2018-04-18 Thread Christian Lütke-Stetzkamp
The data_offset field in msdc_hw is never used, so remove it. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/board.h | 1 - drivers/staging/mt7621-mmc/sd.c| 1 - 2 files changed, 2 deletions(-) diff --git a/drivers/staging/mt7621-mmc/board.h b/drivers/staging

[PATCH 00/31] staging: mt7621-mmc: Next cleanups

2018-04-18 Thread Christian Lütke-Stetzkamp
the future, because the mtk-sd driver is also always using DMA. Christian Lütke-Stetzkamp (31): staging: mt7621-mmc: Remove unused code from board.h staging: mt7621-mmc: Remove unused field get_cd_status from msdc_hw staging: mt7621-mmc: Remove unused field enable_cd_eirq from msdc_hw

[PATCH 14/31] staging: mt7621-mmc: Start cleanup of msdc_dma_config

2018-04-18 Thread Christian Lütke-Stetzkamp
the changes should change the behavior of it (despite the case of a linked scatterlist). Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/sd.c | 29 +++-- 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/drivers/staging/mt7621-mmc

[PATCH 09/31] staging: mt7621-mmc: Relax cpu while waiting for stable clock

2018-04-18 Thread Christian Lütke-Stetzkamp
Current code just busy waits with nop for clock becoming stable, relaxing the cpu here improves readability and portability and also removes a unnecessary difference with the mtk-sd driver. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/sd.c | 2 +- 1 file changed, 1

  1   2   3   >