From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752150AbdCCVVp (ORCPT ); Fri, 3 Mar 2017 16:21:45 -0500 Received: from h1.radempa.de ([176.9.142.194]:49673 "EHLO mail.cosmopool.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751945AbdCCVV2 (ORCPT ); Fri, 3 Mar 2017 16:21:28 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Date: Fri, 03 Mar 2017 22:20:44 +0100 From: Harald Geyer To: Liam Girdwood , Mark Brown , Heiko Stuebner Cc: Subject: [bug] regulator: fixed, gpio: probe fails on unset regulator-name Message-ID: <6fab0e65f184ec621463799512ffad43@ccbib.org> User-Agent: RoundCube Webmail/0.7.2 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi! Documentation/devicetree/bindings/regulator/regulator.txt says that the regulator-name property is optional. However fixed and gpio regulators fail in probe with the following message, if the property is not present: | reg-fixed-voltage regulators:sensor_supply: Failed to allocate supply name | reg-fixed-voltage: probe of regulators:sensor_supply failed with error -12 This is caused by the following code in both drivers: drvdata->desc.name = devm_kstrdup(&pdev->dev, config->supply_name, GFP_KERNEL); if (drvdata->desc.name == NULL) { dev_err(&pdev->dev, "Failed to allocate supply name\n"); return -ENOMEM; } If config->supply_name == NULL, then devm_kstrdup() also returns NULL. I don't know whether the binding document or the implementation is wrong, so can't propose a fix for this. Sorry. TIA, Harald -- If you want to support my work: see http://friends.ccbib.org/harald/supporting/ or donate via peercoin to P98LRdhit3gZbHDBe7ta5jtXrMJUms4p7w or CLAM xASPBtezLNqj4cUe8MT5nZjthRSEjrRQXN