Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp498781ybt; Wed, 24 Jun 2020 04:34:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwrilOBdzP2zm6AHv2/2A+hvIdqIPicqSchDNEBoGL6Qy7Qzw+WOcltzmL1kcoPvj9X2lNk X-Received: by 2002:a17:906:dbe5:: with SMTP id yd5mr10585449ejb.328.1592998469190; Wed, 24 Jun 2020 04:34:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592998469; cv=none; d=google.com; s=arc-20160816; b=cR6EjiV76aq6G9jHpGL1j0ZB7Qh1vHcm+gwBD7Dcf2mUbCn54u4/jcTeoGL0mlK8ii je54dA5KJ89FPrbz+RB+JseNoVyrqiCcGFdH54MCUBeLM94EQgCeSuyiAKlh5Ywqd0Ts ZJ2PZBR3CXFsa/PtE4KOzKy79YYo1ThV0V6hI2v7EY23LJt5ZfC7yOSM8b5DrYM2CM+m dRfxRUuSvcOKMhfgQLkHL4nKwFbDvG+BuZ98Vk81xMboNT9YtQcYuGab1n0lLn/z79eZ b4bQSAgNPleIhfVSiHYcqPp1CpfM4BLrOa571N5P5JLWkH0gLneUNpogvz7x42zpXWlt qvRA== 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:dkim-signature; bh=M4w136qV9ye7K0DDVLlqNAkRV1asdDp2JfRYYYPiLZM=; b=P2bwQzmmgJE2g3qdxLgAGca6Rq+xfy91PqCBLVqBDVQLvDb2iB7X2FDih9V8gu1A3T 3KC4bWqP8e6T/C1XuBDfFRrooivP2JJpv+bEl9+zUm3ymxPSUb7TKiTv+TKsiK/D2cu3 nWJ4I2wyjIU8pDaVmeBcGZ8CXK4mT16ablxeb8gyX2Hxoj895YXS4zgjuXTK9/Fx1d1Z hrFFTz028os5TKjOlsiv2MXPjgq0Bjm9J0b8nVDGJmq1FNia6ThUDxpynUbt+0STQKcn 4dpNbGx8tYbRqbHK31LndQUjvC1PiJSzMpCAl4hcxzon1CtJFvAQylQxOyD0/1L4w1vD 4Ccw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=znhnOspU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id j14si6110915eja.291.2020.06.24.04.34.05; Wed, 24 Jun 2020 04:34:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=znhnOspU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S2389557AbgFXLbZ (ORCPT + 99 others); Wed, 24 Jun 2020 07:31:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:45688 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388470AbgFXLbY (ORCPT ); Wed, 24 Jun 2020 07:31:24 -0400 Received: from mail-lj1-f170.google.com (mail-lj1-f170.google.com [209.85.208.170]) (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 0610C2088E; Wed, 24 Jun 2020 11:31:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592998284; bh=55zvNE05ZrvmYGTKbqcYIdKeiGfLu+9inT+nvPx0ddw=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=znhnOspUf0ZfFz17cYXkM7AcTZQvTU/t+55ntiFjXOb9WhGHWIJ4IJQDMLNfG1fMB glSEDcEh9mduQaCCRs+3whd6AzskjTYR4yfGuYKIZTHNZqs0xM9m4QW/f1tVoQGBxl 18ni3nfIKMIUFUbJS5bYBB9uIelmx9sxSHWJ6Ync= Received: by mail-lj1-f170.google.com with SMTP id q19so2167606lji.2; Wed, 24 Jun 2020 04:31:23 -0700 (PDT) X-Gm-Message-State: AOAM5337tfvN9vlAz/BDIRqO7vTEKIbkswOh4mzUgKNXP/4x5OmlwRlY ZQB+YEUFXi/03qvJsdGYvBEbfGQYQyyu1ZJ65aQ= X-Received: by 2002:a2e:3914:: with SMTP id g20mr2616095lja.19.1592998282326; Wed, 24 Jun 2020 04:31:22 -0700 (PDT) MIME-Version: 1.0 References: <20200624091239.802218-1-ribalda@kernel.org> <20200624104655.GD3703480@smile.fi.intel.com> In-Reply-To: <20200624104655.GD3703480@smile.fi.intel.com> From: Ricardo Ribalda Delgado Date: Wed, 24 Jun 2020 13:31:06 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] i2c: designware: platdrv: Set class based on dmi To: Andy Shevchenko Cc: Jarkko Nikula , Mika Westerberg , linux-i2c@vger.kernel.org, LKML 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 Andy On Wed, Jun 24, 2020 at 12:46 PM Andy Shevchenko wrote: > > On Wed, Jun 24, 2020 at 11:12:39AM +0200, Ricardo Ribalda wrote: > > Current AMD's zen-based APUs use this core for some of its i2c-buses. > > > > With this patch we re-enable autodetection of hwmon-alike devices, so > > lm-sensors will be able to work automatically. > > > > It does not affect the boot-time of embedded devices, as the class is > > set based on the dmi information. > > Hmm... Do we really need to have DMI? I mean wouldn't be safe just always > provide this to be compatible with HWMON class? > I do not care :), I was just trying to follow the logic of 70fba8302adecfa08a087c6f1dd39537a55f5bd3 If it is decided otherwise I can change it, no problem ;) > ... > > > +static bool dw_i2c_hwmon_bus(void) > > +{ > > + if (strstr(dmi_get_system_info(DMI_PRODUCT_NAME), "QT5222")) > > + return true; > > + return false; > > +} > > I don't like this. Perhaps for now you may simple use dmi_get_system_info() > directly below. I just realised that if there is no DMI, then we get a NULL, so we need to add that check. With the two ifs, I still prefer to put it on other function like now (check v2). If you still dont like it I will move it into the main function. > > ... > > > + adap->class = dw_i2c_hwmon_bus() ? I2C_CLASS_HWMON > > + : I2C_CLASS_DEPRECATED; > > It's one line. Fixed thanks > > -- > With Best Regards, > Andy Shevchenko > >