Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1691113ybv; Fri, 21 Feb 2020 01:46:43 -0800 (PST) X-Google-Smtp-Source: APXvYqzqhO8EOZfSkh9WxXkXyU5xrdxdq0xH4tOGwsWVPxTWGbUAnUEdxPILdQSciVoExiCzDuY6 X-Received: by 2002:aca:814:: with SMTP id 20mr1253490oii.159.1582278403433; Fri, 21 Feb 2020 01:46:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582278403; cv=none; d=google.com; s=arc-20160816; b=rbZkDHtcNHRz+qlekDCeNCBIiEZAl7ZI3TfzZSjCivoGTA8oLjdb7+J/Mqhu7C9OD2 xvao+kAqxkvIsfQqxbb7K+UD0YCRdPgbRonYYou+9Yz21DkE9wznySLJZ8VwvPybeo13 g4W/W+2Xd3JJjHFRnManWj9bqAWUFA9FKhC54/Y/WTGvcd/nPY09K5rsdKF4J2I3z7Eu bomfKrJdXsDTN50JtKnwQI9Xe/KMrGNjUPFn/AUJFdygPIuptxSMduG3kR0pKK6RZXiZ uHVTwuKy7OHN3l3HBjb2lmwsuoZGkGr7Km9PPZDzS5u6PLScVo7Dy70agMcJNx3LHun6 aIfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=q+uBU7L8RtfoD9SLjOzf0Rj4Gw7Zsw7mjIUjKd/bLlA=; b=EO7zafPrXRtFugK0ItPmM8HdpFOQVeJbs7Y0qqX/KRPzv4/v+INGYFC+y1nUrJ6Goq MqP/p3+NhS1mhGDp61tiedy90eTGDt1xutdzySaA+tHJJ8QKYqDH0DchWWO3pqf0yqLk CpPmn/Hjy2XQgkPmdI12oKa1EMT0m7rcIEJXg3PF/LddMOULt8zL9xyMQMRNwXvfTdfL vHB4Q4JJ5mjd+yIMB/9j7BQfj1FeS9+JMmSyVzRLuPPsnDK/2qrvZWgRtVAtM4RBHpyl N0GSaXdMorFL0hDj0iOqR3dJHNmX+mxT0DvS1aniwW2cpHKywn+BN+6DTmIDFoH0e7tW wGyg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l21si567549oic.126.2020.02.21.01.46.30; Fri, 21 Feb 2020 01:46:43 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728114AbgBUJqJ (ORCPT + 99 others); Fri, 21 Feb 2020 04:46:09 -0500 Received: from mail-ot1-f68.google.com ([209.85.210.68]:40007 "EHLO mail-ot1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728080AbgBUJqJ (ORCPT ); Fri, 21 Feb 2020 04:46:09 -0500 Received: by mail-ot1-f68.google.com with SMTP id i6so1454151otr.7; Fri, 21 Feb 2020 01:46: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:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=q+uBU7L8RtfoD9SLjOzf0Rj4Gw7Zsw7mjIUjKd/bLlA=; b=eEtP4yfJN9tAMzt4hNdO7woE20WkXq5gQ2E7ttq3s4VtpHzo5mFyYSi3HY6whbt+rm oOYNdwPyXpJ+hGASyof4DhdRP687Dbvld3VcUWS0RLschBpk87DE5CwLQnkRTL5btsje 2mpnzVhIPrXCngouk1o/Eyh2AkfBBSsuLa3sPFmgns/x6G+tJyE4/O1eVD85CMRpDp+0 RHXcS0Fejv/H4xDTfqcleGPezJawUqipVhq14BEYobQIQuQVlmX3oIkRfUkdA2w8kG3d hj8Qyvu7RISZWLytnOWI+YM+QrZqc/m21hzDaddoHME/1AmOhhCn4SwPXpAtDUzBxNPU SuYg== X-Gm-Message-State: APjAAAX+aoFwd7cEdbA6hqbcGRT+yzkVg89CQCqpDrhJ9br5y31okBa8 9ZOlin72KsoFACIhlH6yKNwcikiZJpa11CMTqalpVg== X-Received: by 2002:a9d:7602:: with SMTP id k2mr27652055otl.39.1582278368260; Fri, 21 Feb 2020 01:46:08 -0800 (PST) MIME-Version: 1.0 References: <20200220172403.26062-1-wsa+renesas@sang-engineering.com> <20200220172403.26062-4-wsa+renesas@sang-engineering.com> In-Reply-To: <20200220172403.26062-4-wsa+renesas@sang-engineering.com> From: Geert Uytterhoeven Date: Fri, 21 Feb 2020 10:45:57 +0100 Message-ID: Subject: Re: [RFC PATCH 3/7] i2c: allow DT nodes without 'compatible' To: Wolfram Sang Cc: Linux I2C , Linux-Renesas , linux-i3c@lists.infradead.org, Kieran Bingham , =?UTF-8?Q?Niklas_S=C3=B6derlund?= , Luca Ceresoli , Jacopo Mondi , Laurent Pinchart , Vladimir Zapolskiy , Linux Kernel Mailing List , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Wolfram, On Thu, Feb 20, 2020 at 6:26 PM Wolfram Sang wrote: > Sometimes, we have unknown devices in a system and still want to block > their address. For that, we allow DT nodes with only a 'reg' property. > These devices will be bound to the "dummy" driver but with the name > "reserved". That way, we can distinguish them and even hand them over to > the "dummy" driver later when they are really requested using > i2c_new_ancillary_device(). > > Signed-off-by: Wolfram Sang Thanks for your patch! Reviewed-by: Geert Uytterhoeven but one question below. > --- a/Documentation/devicetree/bindings/i2c/i2c-ocores.txt > +++ b/Documentation/devicetree/bindings/i2c/i2c-ocores.txt > @@ -50,7 +50,6 @@ Examples: > reg-io-width = <1>; /* 8 bit read/write */ > > dummy@60 { > - compatible = "dummy"; > reg = <0x60>; > }; > }; There's a second instance to remove 18 lines below. > --- a/drivers/i2c/i2c-core-of.c > +++ b/drivers/i2c/i2c-core-of.c > @@ -27,17 +27,15 @@ int of_i2c_get_board_info(struct device *dev, struct device_node *node, > > memset(info, 0, sizeof(*info)); > > - if (of_modalias_node(node, info->type, sizeof(info->type)) < 0) { > - dev_err(dev, "of_i2c: modalias failure on %pOF\n", node); > - return -EINVAL; > - } > - > ret = of_property_read_u32(node, "reg", &addr); > if (ret) { > dev_err(dev, "of_i2c: invalid reg on %pOF\n", node); > return ret; > } > > + if (of_modalias_node(node, info->type, sizeof(info->type)) < 0) > + strlcpy(info->type, I2C_RESERVED_DRV_NAME, sizeof(I2C_RESERVED_DRV_NAME)); Could this cause a regression, e.g. if people already have such dummy nodes in their DTS, and use sysfs new_device from userspace to instantiate the device later? Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds