Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1499324

Re: [PATCH v2] RFC: staging: greybus: shape up greybus GPIO

From Viresh Kumar <viresh.kumar@linaro.org>
Newsgroups linux.kernel
Subject Re: [PATCH v2] RFC: staging: greybus: shape up greybus GPIO
Date 2016-10-12 04:30 +0200
Message-ID <srhsR-6yG-5@gated-at.bofh.it> (permalink)
References <sqErw-7rt-23@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


I was looking to exactly do thanks, thanks for doing it before us :)

On 10-10-16, 10:39, Linus Walleij wrote:
>  static int gb_gpio_probe(struct gbphy_device *gbphy_dev,
>  			 const struct gbphy_device_id *id)
>  {
> @@ -690,7 +556,6 @@ static int gb_gpio_probe(struct gbphy_device *gbphy_dev,
>  	gpio->get = gb_gpio_get;
>  	gpio->set = gb_gpio_set;
>  	gpio->set_debounce = gb_gpio_set_debounce;
> -	gpio->to_irq = gb_gpio_to_irq;
>  	gpio->base = -1;		/* Allocate base dynamically */
>  	gpio->ngpio = ggc->line_max + 1;
>  	gpio->can_sleep = true;
> @@ -699,26 +564,26 @@ static int gb_gpio_probe(struct gbphy_device *gbphy_dev,
>  	if (ret)
>  		goto exit_line_free;
>  
> -	ret = gb_gpio_irqchip_add(gpio, irqc, 0,
> -				   handle_level_irq, IRQ_TYPE_NONE);
> +	ret = devm_gpiochip_add_data(&connection->bundle->dev,

We should be using gbphy_dev->dev here instead.

> +				     gpio, ggc);
>  	if (ret) {
>  		dev_err(&connection->bundle->dev,

And also at these places. I will send a patch to fix these separately though.

> -			"failed to add irq chip: %d\n", ret);
> +			"failed to add gpio chip: %d\n", ret);
>  		goto exit_line_free;
>  	}
>  
> -	ret = gpiochip_add(gpio);
> +	ret = gpiochip_irqchip_add(gpio, irqc,
> +				   0, handle_level_irq,
> +				   IRQ_TYPE_NONE);
>  	if (ret) {
>  		dev_err(&connection->bundle->dev,
> -			"failed to add gpio chip: %d\n", ret);
> -		goto exit_gpio_irqchip_remove;
> +			"failed to add gpio irqchip: %d\n", ret);
> +		goto exit_line_free;
>  	}
>  
>  	gbphy_runtime_put_autosuspend(gbphy_dev);
>  	return 0;
>  
> -exit_gpio_irqchip_remove:
> -	gb_gpio_irqchip_remove(ggc);
>  exit_line_free:
>  	kfree(ggc->lines);
>  exit_connection_disable:
> @@ -741,8 +606,6 @@ static void gb_gpio_remove(struct gbphy_device *gbphy_dev)
>  		gbphy_runtime_get_noresume(gbphy_dev);
>  
>  	gb_connection_disable_rx(connection);
> -	gpiochip_remove(&ggc->chip);

This should stay as is, right?

> -	gb_gpio_irqchip_remove(ggc);
>  	gb_connection_disable(connection);
>  	gb_connection_destroy(connection);
>  	kfree(ggc->lines);

-- 
viresh

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH v2] RFC: staging: greybus: shape up greybus GPIO Linus Walleij <linus.walleij@linaro.org> - 2016-10-10 10:50 +0200
  Re: [PATCH v2] RFC: staging: greybus: shape up greybus GPIO Rui Miguel Silva <rmfrfs@gmail.com> - 2016-10-10 16:30 +0200
  Re: [PATCH v2] RFC: staging: greybus: shape up greybus GPIO Viresh Kumar <viresh.kumar@linaro.org> - 2016-10-12 04:30 +0200

csiph-web