From patchwork Wed Dec 5 19:50:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rob Herring \(Arm\)" X-Patchwork-Id: 152965 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp9697160ljp; Wed, 5 Dec 2018 11:53:22 -0800 (PST) X-Google-Smtp-Source: AFSGD/U0KflILrwauzbW6IzACyLY1r7Ye3tfuwLJtihlNa7YS606B3+lN04s9lZAv3DlrkL2dhSh X-Received: by 2002:a65:6491:: with SMTP id e17mr21418563pgv.418.1544039602385; Wed, 05 Dec 2018 11:53:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544039602; cv=none; d=google.com; s=arc-20160816; b=gmkF60o30YPOG2chVUQiB7ncD5dZ0Sr5fDAdezWm6efgD8HAur+bYdmc52fEaHVTif mmBZENaFiJ5B2OnGcxaPRW9g85t+FxDg06v3tVm8BA7Ogqsq3yL5tOYg6bNh4YAqeUfk 4U2yX1ibMG+VfS2vWW/ZbG3eVkcj499YMkZCxdc3X+2VeGFSYocfOwAYhFacTqHS/pGf cOWYjjvZd15nS1ClO9WJjK+gIdUq43Bt8w2nfXHOTYaAKzJV1Y27h4VyQDtxOEkNg+m3 Lryqfead6l8PC2gea6z4apiUxPlDGrX3lH0RiC5devwBQHoxOqhGbwgkFXtmmNGXmhYM 3xmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=nQc83SVC/fPoNgqivTxVXJ/5HoDZLYAlNXFAVWXqJR0=; b=WnAEDg/gQ3gnlSWbnCYHkdCHdlbMsLGTxpEhsBJDIGe45QUwnTPq9aLACbatTeBwG+ KwhFxU8y9ZD+ckkdknz9iHNBwW9aEk3J1UpHL/FKg4Cy/iOoyKz93o7c3TNxmLZ5of8W GonchlsrZ/3Hd8xFDNsj5ejnaL/VIi06NqdeeDuQ7ZEGehUa2Q4gkWN/grqByG2bHq6H erZFFz0TknuynIRGemUv2Xq2Sp+OjDeWYJrgN0FNU29nmNEZEnN58k0xoO9nFFbgJMXK qbQx9vDQ1JsLBloAK54jkyItP8/ju7Q3pE9h3tje4NP+V7o+ZReMqqsrYcs2mV+5fSFm GHQQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 72si10711945pla.218.2018.12.05.11.53.22; Wed, 05 Dec 2018 11:53:22 -0800 (PST) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728893AbeLETxU (ORCPT + 31 others); Wed, 5 Dec 2018 14:53:20 -0500 Received: from mail-oi1-f196.google.com ([209.85.167.196]:44968 "EHLO mail-oi1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728667AbeLETvI (ORCPT ); Wed, 5 Dec 2018 14:51:08 -0500 Received: by mail-oi1-f196.google.com with SMTP id m6so18611492oig.11; Wed, 05 Dec 2018 11:51:08 -0800 (PST) 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:mime-version :content-transfer-encoding; bh=nQc83SVC/fPoNgqivTxVXJ/5HoDZLYAlNXFAVWXqJR0=; b=DFM4ruFVs5O/c6K0jlgzew3lSis9bBhC/GSEcy3YdIEXxQGK7RfVmgYvEinQrcs1Ft qLenr2srZRBj7b2adnq0CKqpbBjl9zEVhlpgE1GVEAcJkgkDw98RRBOeH+4l67zKkZFr 0Z3i28Z6phXE3rJzdYvplsPX7mAtokQyCAgJBUH7eTx3LOgKmxhDaU7RuIcwvO87D6jI unvC6avB95afBL//OjlwT8WMBSLd6iwkdGUi11OCCRYR9OnGWoTyVIiLk0FMS3lDLwIU DCoUVb1V+/06jqcooNCMlyEae8iCduMVWwFoFu/iCklp7ZpQFjc8E87Q6VAEZLBBQHQw E/vA== X-Gm-Message-State: AA+aEWYmCRKTPaB3EcmL8x2UwvM5hCk2Su4cAx5xYp+ExwcHRV6j4oPW 5Zzz4MY4Xl4XEh/qGWJEfnNcwUs= X-Received: by 2002:aca:f103:: with SMTP id p3mr15094422oih.94.1544039467448; Wed, 05 Dec 2018 11:51:07 -0800 (PST) Received: from xps15.herring.priv (24-155-109-49.dyn.grandenetworks.net. [24.155.109.49]) by smtp.googlemail.com with ESMTPSA id k13sm25759879otj.19.2018.12.05.11.51.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Dec 2018 11:51:06 -0800 (PST) From: Rob Herring To: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Lee Jones Subject: [PATCH] mfd: Use of_node_name_eq for node name comparisons Date: Wed, 5 Dec 2018 13:50:31 -0600 Message-Id: <20181205195050.4759-15-robh@kernel.org> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Convert string compares of DT node names to use of_node_name_eq helper instead. This removes direct access to the node name pointer. Cc: Lee Jones Signed-off-by: Rob Herring --- drivers/mfd/max77620.c | 2 +- drivers/mfd/stmpe.c | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) -- 2.19.1 diff --git a/drivers/mfd/max77620.c b/drivers/mfd/max77620.c index d8217366ed36..d8ddd1a6f304 100644 --- a/drivers/mfd/max77620.c +++ b/drivers/mfd/max77620.c @@ -280,7 +280,7 @@ static int max77620_config_fps(struct max77620_chip *chip, for (fps_id = 0; fps_id < MAX77620_FPS_COUNT; fps_id++) { sprintf(fps_name, "fps%d", fps_id); - if (!strcmp(fps_np->name, fps_name)) + if (of_node_name_eq(fps_np, fps_name)) break; } diff --git a/drivers/mfd/stmpe.c b/drivers/mfd/stmpe.c index 566caca4efd8..7569a4be0608 100644 --- a/drivers/mfd/stmpe.c +++ b/drivers/mfd/stmpe.c @@ -1302,17 +1302,17 @@ static void stmpe_of_probe(struct stmpe_platform_data *pdata, pdata->autosleep = (pdata->autosleep_timeout) ? true : false; for_each_child_of_node(np, child) { - if (!strcmp(child->name, "stmpe_gpio")) { + if (of_node_name_eq(child, "stmpe_gpio")) { pdata->blocks |= STMPE_BLOCK_GPIO; - } else if (!strcmp(child->name, "stmpe_keypad")) { + } else if (of_node_name_eq(child, "stmpe_keypad")) { pdata->blocks |= STMPE_BLOCK_KEYPAD; - } else if (!strcmp(child->name, "stmpe_touchscreen")) { + } else if (of_node_name_eq(child, "stmpe_touchscreen")) { pdata->blocks |= STMPE_BLOCK_TOUCHSCREEN; - } else if (!strcmp(child->name, "stmpe_adc")) { + } else if (of_node_name_eq(child, "stmpe_adc")) { pdata->blocks |= STMPE_BLOCK_ADC; - } else if (!strcmp(child->name, "stmpe_pwm")) { + } else if (of_node_name_eq(child, "stmpe_pwm")) { pdata->blocks |= STMPE_BLOCK_PWM; - } else if (!strcmp(child->name, "stmpe_rotator")) { + } else if (of_node_name_eq(child, "stmpe_rotator")) { pdata->blocks |= STMPE_BLOCK_ROTATOR; } }