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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
: 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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
: 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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
)
^~~~
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
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
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
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.
> >
> >
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
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
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
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
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
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
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
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
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
)
^~~~
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
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
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
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
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
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 - 100 of 265 matches
Mail list logo