diff mbox

[v2,5/5] fpga: region: return NOTIFY_STOP if overlay shoud be accepted

Message ID 1510779112-5517-6-git-send-email-atull@kernel.org (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Alan Tull Nov. 15, 2017, 8:51 p.m. UTC
Recent changes to the Device Tree overlay notifier code have changed
how notifier return codes are interpreted, requiring a NOTIFY_STOP to
signal that the overlay should be accepted.  This commit makes the
appropriate change to the FPGA region's Device Tree overlay notifier.

Fixes: 24789c5ce5a3 ("of: overlay: detect cases where device tree may become corrupt")
Signed-off-by: Alan Tull <atull@kernel.org>
---
v2: Added in v2 of this patchset.  Tested on linux-next/master.
---
 drivers/fpga/of-fpga-region.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Moritz Fischer Dec. 7, 2017, 11:27 p.m. UTC | #1
On Wed, Nov 15, 2017 at 02:51:52PM -0600, Alan Tull wrote:
> Recent changes to the Device Tree overlay notifier code have changed
> how notifier return codes are interpreted, requiring a NOTIFY_STOP to
> signal that the overlay should be accepted.  This commit makes the
> appropriate change to the FPGA region's Device Tree overlay notifier.
> 
> Fixes: 24789c5ce5a3 ("of: overlay: detect cases where device tree may become corrupt")
> Signed-off-by: Alan Tull <atull@kernel.org>
Reviewed-by: Moritz Fischer <mdf@kernel.org>
> ---
> v2: Added in v2 of this patchset.  Tested on linux-next/master.
> ---
>  drivers/fpga/of-fpga-region.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/fpga/of-fpga-region.c b/drivers/fpga/of-fpga-region.c
> index 276ffe2..a0c13cb 100644
> --- a/drivers/fpga/of-fpga-region.c
> +++ b/drivers/fpga/of-fpga-region.c
> @@ -349,7 +349,8 @@ static void of_fpga_region_notify_post_remove(struct fpga_region *region,
>   * This notifier handles programming a FPGA when a "firmware-name" property is
>   * added to a fpga-region.
>   *
> - * Returns NOTIFY_OK or error if FPGA programming fails.
> + * Returns NOTIFY_OK if this notification isn't about this region or
> + * NOTIFY_STOP if the overaly is to be accepted or error if FPGA programming fails.
>   */
>  static int of_fpga_region_notify(struct notifier_block *nb,
>  				 unsigned long action, void *arg)
> @@ -395,7 +396,7 @@ static int of_fpga_region_notify(struct notifier_block *nb,
>  	if (ret)
>  		return notifier_from_errno(ret);
>  
> -	return NOTIFY_OK;
> +	return NOTIFY_STOP;
>  }
>  
>  static struct notifier_block fpga_region_of_nb = {
> -- 
> 2.7.4
> 

Thanks,

Moritz
Alan Tull Dec. 8, 2017, 5:30 p.m. UTC | #2
On Thu, Dec 7, 2017 at 5:27 PM, Moritz Fischer <mdf@kernel.org> wrote:
> On Wed, Nov 15, 2017 at 02:51:52PM -0600, Alan Tull wrote:
>> Recent changes to the Device Tree overlay notifier code have changed
>> how notifier return codes are interpreted, requiring a NOTIFY_STOP to
>> signal that the overlay should be accepted.  This commit makes the
>> appropriate change to the FPGA region's Device Tree overlay notifier.
>>
>> Fixes: 24789c5ce5a3 ("of: overlay: detect cases where device tree may become corrupt")
>> Signed-off-by: Alan Tull <atull@kernel.org>
> Reviewed-by: Moritz Fischer <mdf@kernel.org>

Thanks!
Alan
--
To unsubscribe from this list: send the line "unsubscribe linux-fpga" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/fpga/of-fpga-region.c b/drivers/fpga/of-fpga-region.c
index 276ffe2..a0c13cb 100644
--- a/drivers/fpga/of-fpga-region.c
+++ b/drivers/fpga/of-fpga-region.c
@@ -349,7 +349,8 @@  static void of_fpga_region_notify_post_remove(struct fpga_region *region,
  * This notifier handles programming a FPGA when a "firmware-name" property is
  * added to a fpga-region.
  *
- * Returns NOTIFY_OK or error if FPGA programming fails.
+ * Returns NOTIFY_OK if this notification isn't about this region or
+ * NOTIFY_STOP if the overaly is to be accepted or error if FPGA programming fails.
  */
 static int of_fpga_region_notify(struct notifier_block *nb,
 				 unsigned long action, void *arg)
@@ -395,7 +396,7 @@  static int of_fpga_region_notify(struct notifier_block *nb,
 	if (ret)
 		return notifier_from_errno(ret);
 
-	return NOTIFY_OK;
+	return NOTIFY_STOP;
 }
 
 static struct notifier_block fpga_region_of_nb = {