[PATCH 2/3] staging: mt7621-pci: use generic kernel pci subsystem read and write

Sergio Paracuellos sergio.paracuellos at gmail.com
Wed Jul 11 12:16:09 UTC 2018


On Wed, Jul 11, 2018 at 10:29:43AM +0300, Dan Carpenter wrote:
> On Tue, Jul 10, 2018 at 09:33:47PM +0200, Sergio Paracuellos wrote:
> > +static int mt7621_pcie_parse_dt(struct mt7621_pcie_port *port)
> > +{
> > +	struct device *dev = port->dev;
> > +	struct device_node *node = dev->of_node;
> > +	struct resource regs;
> > +	const char *type;
> > +	int err;
> > +
> > +	type = of_get_property(node, "device_type", NULL);
> > +	if (!type || strcmp(type, "pci")) {
> 
> Instead of testing for pci, can you test for pcie?

All device tree's I've checked looking for what this should be done
has "pci" as device_type defined and checked accordly in code (current
mt7621 DTS also). That's why "pci" is checked.

> 
> I always like to use the == 0 and != 0 with strcmp() because it's easier
> to think about type == pci or type != pcie.

Thanks for the advice, maybe you are right and is more clear in the way
you are describing here.

> 
> regards,
> dan carpenter
> 

Best regards,
    Sergio Paracuellos


More information about the devel mailing list