On Mon, Jul 09, 2018 at 10:21:06PM +0200, Sergio Paracuellos wrote:
> The logic for this functions is kind of mess calling to other
> functions which ends up in using very ugly macros. Reimplement
> this two using kernel write[b,w,l] and read[b,w,l] and the variable
> 'mt7621_pci_base'. Function prototypes have changed style to avoid
> long lines.
>
> Signed-off-by: Sergio Paracuellos <[email protected]>
> ---
> drivers/staging/mt7621-pci/pci-mt7621.c | 54
> +++++++++++++++++++++++++++------
> 1 file changed, 44 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c
> b/drivers/staging/mt7621-pci/pci-mt7621.c
> index b745423..122c046 100644
> --- a/drivers/staging/mt7621-pci/pci-mt7621.c
> +++ b/drivers/staging/mt7621-pci/pci-mt7621.c
> @@ -273,29 +273,63 @@ write_config_dword(struct pci_bus *bus, unsigned int
> devfn, int where, u32 val)
> }
>
> static int
> -pci_config_read(struct pci_bus *bus, unsigned int devfn, int where, int
> size, u32 *val)
> +pci_config_read(struct pci_bus *bus, unsigned int devfn,
> + int where, int size, u32 *val)
I love it how drivers think they need to duplcate functions that the pci
core provides you already.
{sigh}
Why is this even needed? Why can't the pci functions be used instead?
This 'hand-rolled' function is just horrid, even after you have tried to
fix it up.
thanks,
greg k-h
_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel