Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp4641117imm; Mon, 15 Oct 2018 19:41:43 -0700 (PDT) X-Google-Smtp-Source: ACcGV60SzN3QjPG5Mf3RRuSn3qC252GKbCqiLSDX1ROYLbJpcoGofJVruQ0LJyLNSZ87ullnFvVI X-Received: by 2002:a63:e05:: with SMTP id d5-v6mr18300358pgl.272.1539657703618; Mon, 15 Oct 2018 19:41:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539657703; cv=none; d=google.com; s=arc-20160816; b=ktzIpEL/T7CUwf159rY3/zkLtuO5FihNERFHaEtQRsioEmL/Opj7JFYqSIAbzr1V9N ivWAWTZS6YCsblFlmNckl0MEmMBuLlJrokBbpdR1w5VxqLle+Wndpk/ofNQc5FkRLXWU aQp42AySg0dzOTgycpwSSXAYSTHEFM6vaoolnaQtitgH+kSvb33DOUvqW1yTdx4ciEm1 Rd6lIbublVNl/25Y+s6DieGbccmoudl3D+GB5IAGcQ/a3yeGjz7axZuUKiFeNVFLFvPj 4bHcMUjk2S2B57P5sWGNDQYmtAALzl5HywjLao0dyQW0xf/lHzggPAfByDqjMf2abmvS ERqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=k3NmJ/BND4BSxo8ekIb0GkfOMcrXW/U/Gc8POw3t3ig=; b=LKmNh5lL1bVyZnw5l/Ku7CD62oZ8sSmEm2omEP7yHbOhkBcVzJAJ4pKRVYkLSHDH4Y 7XdMS2Cxu4ro0SWy+AeLnBNRqmaNAxdUZEIJUCqm3+031Xr6QYYOaJjcchwzo2/NFhMI 07TKnyUk1L6us1r0nqHaorAAkDLRFYSzlEhyv8yWIQBE4giJP3yDadYjqZsQ5BCLPazw gV2ro2G4YGxUvAJfS90WKKw/iy87sCCINxQtH3DCsMcDeScetBXxXrfpc7iRiXWbnlyf 7l3/2nIXCKlWfctk7Y4iWRK01HEf29OgjX9XD32GozQYmvg1ujw5CM+ILq98yxDLIfOH H8mA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=OaiPvwD2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ce19-v6si13581955plb.162.2018.10.15.19.41.28; Mon, 15 Oct 2018 19:41:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=OaiPvwD2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727416AbeJPK2k (ORCPT + 99 others); Tue, 16 Oct 2018 06:28:40 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:42630 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727081AbeJPK1Y (ORCPT ); Tue, 16 Oct 2018 06:27:24 -0400 Received: by mail-pg1-f196.google.com with SMTP id i4-v6so10069466pgq.9; Mon, 15 Oct 2018 19:39:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=k3NmJ/BND4BSxo8ekIb0GkfOMcrXW/U/Gc8POw3t3ig=; b=OaiPvwD2plx5vYUSDpsUGWs6tzYyUjWreHYu+XdKfwBAlhsu3Q3eb2Rv0hY8fzQRwJ z7Yk+FjvhywQV2WSV4zDj5Mh4BDJax+OE2YsMA23u4+KLKtcz0qRqyJalx5bq7E1quwK z4EDorVOpK6Y6T38JJ24T9ocJFFcqv882VNZawoXSaRjHbBTEiW5iEmpdjyBaoy+JjwV q+JgRCExj9IAg9yU3nWSBc/mYEtjYHexrR8AUUja24MeQX9nqKPuFRQ3iV5GSXKtnQvW l9H6T5HxJFEo/1zsM1op0nRFSDKW6l2eSNWmnXp03wZB+EGEXqQuU2uMWvdMUPh1KfUR DyfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=k3NmJ/BND4BSxo8ekIb0GkfOMcrXW/U/Gc8POw3t3ig=; b=EjTFpC/FP8hlc1S7Y1QjRMqDVosGUCddok17SASbgNDQexfZwKdkDRbvYyzXDwm0m4 jB9dBz/QpRVXOc+sBvC4KFjAKtIdb2izDeIpO/D1zwQg/xUH30IgsRR+3QCedJt5/IG3 9Bv5UtPAUGdyTJ2AHjQWmQI/gKtY+Ud/NaSwN4l3nq/5Ms19PnFiEgRwcmrDI5BIMeWL 9dzWZVRwAdBRuLsSHFOGmNypiKolXVW2Z7pnEgX65w0XH7X9ASu6pj6AC37tYf9NjssO 1icFRGhPo3zt0PUZ68wzlAubCpV8wkGresXj7n/umpAIxZZpASVj2PBkXOxnHsaRaM5/ nRQA== X-Gm-Message-State: ABuFfoizeRJlmT+G6osQTqNBfX/rKUn+PelmR1xd5fQh2zTI2ro9yssr UyqCyIsSCi7md7fwxaGAWHU= X-Received: by 2002:a62:1c06:: with SMTP id c6-v6mr20404340pfc.41.1539657560194; Mon, 15 Oct 2018 19:39:20 -0700 (PDT) Received: from localhost.localdomain (c-24-6-192-50.hsd1.ca.comcast.net. [24.6.192.50]) by smtp.gmail.com with ESMTPSA id u79-v6sm18620287pfd.117.2018.10.15.19.39.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 15 Oct 2018 19:39:19 -0700 (PDT) From: frowand.list@gmail.com To: Rob Herring , Pantelis Antoniou , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Alan Tull , Moritz Fischer Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, devicetree@vger.kernel.org, linux-fpga@vger.kernel.org Subject: [PATCH v4 07/18] of: dynamic: change type of of_{at,de}tach_node() to void Date: Mon, 15 Oct 2018 19:37:27 -0700 Message-Id: <1539657458-24401-8-git-send-email-frowand.list@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1539657458-24401-1-git-send-email-frowand.list@gmail.com> References: <1539657458-24401-1-git-send-email-frowand.list@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Frank Rowand of_attach_node() and of_detach_node() always return zero, so their return value is meaningless. Change their type to void and fix all callers to ignore return value. Signed-off-by: Frank Rowand --- arch/powerpc/platforms/pseries/dlpar.c | 13 ++----------- arch/powerpc/platforms/pseries/reconfig.c | 6 +----- drivers/of/dynamic.c | 9 ++------- include/linux/of.h | 4 ++-- 4 files changed, 7 insertions(+), 25 deletions(-) diff --git a/arch/powerpc/platforms/pseries/dlpar.c b/arch/powerpc/platforms/pseries/dlpar.c index e3010b14aea5..0027eea94a8b 100644 --- a/arch/powerpc/platforms/pseries/dlpar.c +++ b/arch/powerpc/platforms/pseries/dlpar.c @@ -244,15 +244,9 @@ struct device_node *dlpar_configure_connector(__be32 drc_index, int dlpar_attach_node(struct device_node *dn, struct device_node *parent) { - int rc; - dn->parent = parent; - rc = of_attach_node(dn); - if (rc) { - printk(KERN_ERR "Failed to add device node %pOF\n", dn); - return rc; - } + of_attach_node(dn); return 0; } @@ -260,7 +254,6 @@ int dlpar_attach_node(struct device_node *dn, struct device_node *parent) int dlpar_detach_node(struct device_node *dn) { struct device_node *child; - int rc; child = of_get_next_child(dn, NULL); while (child) { @@ -268,9 +261,7 @@ int dlpar_detach_node(struct device_node *dn) child = of_get_next_child(dn, child); } - rc = of_detach_node(dn); - if (rc) - return rc; + of_detach_node(dn); of_node_put(dn); diff --git a/arch/powerpc/platforms/pseries/reconfig.c b/arch/powerpc/platforms/pseries/reconfig.c index 0e0208117e77..0b72098da454 100644 --- a/arch/powerpc/platforms/pseries/reconfig.c +++ b/arch/powerpc/platforms/pseries/reconfig.c @@ -47,11 +47,7 @@ static int pSeries_reconfig_add_node(const char *path, struct property *proplist goto out_err; } - err = of_attach_node(np); - if (err) { - printk(KERN_ERR "Failed to add device node %s\n", path); - goto out_err; - } + of_attach_node(np); of_node_put(np->parent); diff --git a/drivers/of/dynamic.c b/drivers/of/dynamic.c index fe8816cca99b..a94f727ec3da 100644 --- a/drivers/of/dynamic.c +++ b/drivers/of/dynamic.c @@ -224,7 +224,7 @@ static void __of_attach_node(struct device_node *np) /** * of_attach_node() - Plug a device node into the tree and global list. */ -int of_attach_node(struct device_node *np) +void of_attach_node(struct device_node *np) { struct of_reconfig_data rd; unsigned long flags; @@ -241,8 +241,6 @@ int of_attach_node(struct device_node *np) mutex_unlock(&of_mutex); of_reconfig_notify(OF_RECONFIG_ATTACH_NODE, &rd); - - return 0; } void __of_detach_node(struct device_node *np) @@ -273,11 +271,10 @@ void __of_detach_node(struct device_node *np) /** * of_detach_node() - "Unplug" a node from the device tree. */ -int of_detach_node(struct device_node *np) +void of_detach_node(struct device_node *np) { struct of_reconfig_data rd; unsigned long flags; - int rc = 0; memset(&rd, 0, sizeof(rd)); rd.dn = np; @@ -291,8 +288,6 @@ int of_detach_node(struct device_node *np) mutex_unlock(&of_mutex); of_reconfig_notify(OF_RECONFIG_DETACH_NODE, &rd); - - return rc; } EXPORT_SYMBOL_GPL(of_detach_node); diff --git a/include/linux/of.h b/include/linux/of.h index aa1dafaec6ae..72c593455019 100644 --- a/include/linux/of.h +++ b/include/linux/of.h @@ -406,8 +406,8 @@ extern int of_phandle_iterator_args(struct of_phandle_iterator *it, #define OF_RECONFIG_REMOVE_PROPERTY 0x0004 #define OF_RECONFIG_UPDATE_PROPERTY 0x0005 -extern int of_attach_node(struct device_node *); -extern int of_detach_node(struct device_node *); +extern void of_attach_node(struct device_node *np); +extern void of_detach_node(struct device_node *np); #define of_match_ptr(_ptr) (_ptr) -- Frank Rowand