Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp685817yba; Fri, 12 Apr 2019 11:34:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqzamx7PM2Q3UbmPeHmDCi+0RBopQlW16jo6NRrUT8+vUJgyGbG9OJBb/EgblY8qnxJlXFFM X-Received: by 2002:a17:902:2f:: with SMTP id 44mr16951244pla.137.1555094046994; Fri, 12 Apr 2019 11:34:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555094046; cv=none; d=google.com; s=arc-20160816; b=VlN128vpj4+ysl6vACmcotsoIp1hW7EVKEAEcYtr1oqt2vJMXLA14CZLmx5+urNzmn DGSE+WlICexVwQ5jqWYVpvFIWspA7EfUVu6vUVIVXbE26T/aNwXRV2dZ9MERiwb1RNzz W3Pa3IBxth4biuQHnu50r3NJ8cilkXetFMyWG8C3Z40v9RxeGCmtDy9+hBaywQw/4fCi TVVV/B7U8xyVNoyWUUqAmLPVCBA+ao0AJhZvNIPdhULjglsEQF29BstUtsLaya0Y4dUk xHFmwzMczNVtIdHsFR6QhhKScdGT/xrfDdwjNs5H50A9kQvmPit0KhkTNrSJND14+m7s YIVg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=SPnnQNTZOWr4NucM+8vqQteiyGDtsK/K2iWK/U2g5us=; b=rtquem0cb6y6xC610UqneGnkJOFjYPpbDa3Xo94wn0FRQ+qPy4Y9vcN9wrAbd/A53F LjgGBrYqJuwgwBIWXoEQ9WjQfwq4G/6v1d0uqZ/B9wmZMUjlNtTdgP/VyWtWmjMtLWPD UXOIBDU8UIWeC095C5uZ7+OcghlzxTPdqgk9pCiAAZnun478z8d3Y6wiui4YIkHIA5qd Ft1DTxhBx/45kJPpgIPacrIa5HBzVQJG2g4oppVkZygM3RomJI3F+o8CyLKCiqlI+E8P l7rAHlJrT2Vc0+wSwljMvDGnUXha66cxd5jpHygPZMuQkrxMW5yNp5NJTqcrLWOgoUjh OpPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=QvPLFGT1; 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=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 2si15553281pld.334.2019.04.12.11.33.51; Fri, 12 Apr 2019 11:34:06 -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=@kernel.org header.s=default header.b=QvPLFGT1; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727263AbfDLScd (ORCPT + 99 others); Fri, 12 Apr 2019 14:32:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:50366 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726998AbfDLSbx (ORCPT ); Fri, 12 Apr 2019 14:31:53 -0400 Received: from mail.kernel.org (unknown [104.132.0.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 07613218E2; Fri, 12 Apr 2019 18:31:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555093913; bh=Lu/9VefXJAzydhxIjej1T+ELCdL9m/fzpv8TsunMCNs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QvPLFGT1GXjOboeqPPBAcckRG30U7zHLFyGRg25ud38AwbhLZXd+ikeM5hKtX6JPH 7Uv5aBBMHFZMZ75QzI+OfTsIqt9AXYoe7fkrdrkyzbN9vnPQz4FJiGti4i/6Rg9L5B LUNtqbaZpK02JuyCx2OdHXWRriPk8GSwuM5omh4c= From: Stephen Boyd To: Michael Turquette , Stephen Boyd Cc: linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, Miquel Raynal , Jerome Brunet , Russell King , Jeffrey Hugo , Chen-Yu Tsai , Greg Kroah-Hartman , Rob Herring Subject: [PATCH v4 4/9] driver core: Let dev_of_node() accept a NULL dev Date: Fri, 12 Apr 2019 11:31:45 -0700 Message-Id: <20190412183150.102131-5-sboyd@kernel.org> X-Mailer: git-send-email 2.21.0.392.gf8f6787159e-goog In-Reply-To: <20190412183150.102131-1-sboyd@kernel.org> References: <20190412183150.102131-1-sboyd@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We'd like to chain this in places where the 'dev' argument might be NULL. Let this function take a NULL 'dev' so this can work. Cc: Miquel Raynal Cc: Jerome Brunet Cc: Russell King Cc: Michael Turquette Cc: Jeffrey Hugo Cc: Chen-Yu Tsai Cc: Greg Kroah-Hartman Cc: Rob Herring Signed-off-by: Stephen Boyd --- Please ack/review so I can take this through clk tree. include/linux/device.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/device.h b/include/linux/device.h index b425a7ee04ce..0370dd0b3ae7 100644 --- a/include/linux/device.h +++ b/include/linux/device.h @@ -1231,7 +1231,7 @@ static inline void device_lock_assert(struct device *dev) static inline struct device_node *dev_of_node(struct device *dev) { - if (!IS_ENABLED(CONFIG_OF)) + if (!IS_ENABLED(CONFIG_OF) || !dev) return NULL; return dev->of_node; } -- Sent by a computer through tubes