RE: [PATCH 2/2] input: gpio-joy - GPIO joystick driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




> > +static int gpio_joy_probe(struct platform_device *pdev) {
> > +	struct device *dev = &pdev->dev;
> > +	struct input_dev *input;
> > +	struct gpio_joy_drvdata *ddata;
> > +	int i, err;
> > +	unsigned int debounce_ms;
> 
> This should be a u32 given you pass it to a function expecting a u32 pointer.
> 
> > +
> > +	ddata = devm_kzalloc(dev, sizeof(struct gpio_joy_drvdata),
> > +GFP_KERNEL);
> 
> Use sizeof(*ddata)
> 
> [...]
> 
> > +	return 0;
> > +fail:
> > +	return err;
> > +}
> 
> Given there's no cleanup, the fail path seems redundant.
> 
> [...]
> 
> > +static const struct of_device_id gpio_joy_of_match[] = {
> > +	{ .compatible = DRV_NAME, },
> > +	{ },
> > +};
> 
> The compatible string should be independent of DRV_NAME, because it must
> match the binding. The driver can be arbitrarily and independently renamed.
> 

I'll address all of these comments, thanks for reviewing!
Hans
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]
  Powered by Linux