Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp25341pxt; Wed, 4 Aug 2021 14:42:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy/YwPlJfl6tzLvci07639ZGS2c/e2FyC5oUX7qt+yLip7tbTs83E0DtFKuMPQyoShwzwWG X-Received: by 2002:a05:6402:2297:: with SMTP id cw23mr2084200edb.329.1628113375591; Wed, 04 Aug 2021 14:42:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628113375; cv=none; d=google.com; s=arc-20160816; b=II3s0z2VXcFQenhlYKdAN07DWYa0ARAt1Hzg2nKfu4yv9iS2pwm+SlIHmvL1mrEC6O iyiBsMhHjhTfM3DsWRjHvXx8VWAUTRLSyPg7piLxfCLuPoZSfEmj64H99+29PUDRqcWe A2o7vvqRAwL+DEi9U/0InaR8AYSAzzwDtWXSz/ydieICSQohSF1fCtBbPjGbDpG9j3bm msFnOXUxmDk8P/Abu4dhTXC0JtCo3Tac7HEQHIM+jskDotaky9qwdJbDWBhDMdSWCF6F zcsLd/H2dsJj8uWO5MsnBOWoGBSmGaJpxlGQnMskQqxmMD/H7qK1W6GNXH9+Y1xkLWba ZsWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=WNboISic187HJKXZS9VE236kup1IeE1JWro+1xmidcM=; b=gIBWE+8wKTMguDTJliyslVD83gHd0lrk11/o/E4YdBrV541NtV/R1CFPlFSyORc035 62da5+TwXU3PsvJpwQexE4aJka1kO69tayvk9w68WgQpgXVADCWKggXeLadysyMjagyW FAOkeUuem1GIS6olKIiPK+3vyO1hT7b91ov5He4IEg3gL7OaXzCX5vkDwvSQNXMBZCaa fzu6vK9L3Dweb7Xqpw/WpfMyD3AD1ccuujxdtdP5IAURrOOVW/+1ZF6fADvblVnnPo6u lD3sUnLOxydCkzv5K6mjfX8rjfZzZAlDjHZY1z3NawHHQ80HNNRXRM3bItzFbh940KlD tocg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=GJPbeGh5; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w13si3655910ede.389.2021.08.04.14.42.27; Wed, 04 Aug 2021 14:42:55 -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=@gmail.com header.s=20161025 header.b=GJPbeGh5; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240785AbhHDT2b (ORCPT + 99 others); Wed, 4 Aug 2021 15:28:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39448 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240768AbhHDT21 (ORCPT ); Wed, 4 Aug 2021 15:28:27 -0400 Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 654ACC0617BD; Wed, 4 Aug 2021 12:28:11 -0700 (PDT) Received: by mail-pj1-x1029.google.com with SMTP id e2-20020a17090a4a02b029016f3020d867so5007827pjh.3; Wed, 04 Aug 2021 12:28:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=WNboISic187HJKXZS9VE236kup1IeE1JWro+1xmidcM=; b=GJPbeGh55CJKv39VJSXNqgMjxD1h+2nXiUD3qVFJON7Juuw4/HWc9gntuzSOCLjlsE FVnc/OTP3sdFyDJ5ifb4uSgHQZng9wmTtC4+Kbb5/V82h1W+dCtIm3DXRmPXOE4LKlwz id1hgnf7Z/TL0Q0oMM4bx05GufqGJ1KvDr8HWHySrVTdKWB0IKd+8sy4XqVkUKigLZyo 7md6QI96hWS/kgzS79s5sKV5bYcANCghSiPga3u3hmWNTS2f2NoTGPQsq1YG7mI7EAyT 6ug/fVH3USnb2okw582C2uz4jejx4P2STwtKDQ7TWvpVsakmn6tO5I6EbCX3OLbj+A+0 fA3Q== 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=WNboISic187HJKXZS9VE236kup1IeE1JWro+1xmidcM=; b=uZsj0LIbauQleNP5zYXL0oGtYnzh6zbLOFrd+YHJmOmf+2Y7JfXjzmpAuTDh8IxxmN FeuBGMpXE/8DxOeVyYw0iDB6RNLHQfYWv+4N7uncxyB6VgdJNDooQIr9+Po85EuEpCQt E2AwUEoRaJP+xH8PcW3N68EG2QXtPdtRkbtCQLOrVbB78pHHHu+PRp0GZ+Rd3nmvIbo0 J6gwSjIzd2FJfN6OJsQRP6zb3nqac8VOYKbCkiQ3lQgqyvc1KZFrw/UM6kjSW7up/Cu+ z61RXERSfWdxSohwqe/ilxHcBQVXHCj3k9mdAneUG3nqcHmZTajuCe2lUAGTWtup0p4E z79w== X-Gm-Message-State: AOAM531Oisuu3OUJxSgrYua0N6lwHeGiv/e5rmiif0HuduIorHIAw5Df EHGdgksKXkS7julH1nGJCYx6/qXzV7XaznsoUoA= X-Received: by 2002:a17:902:ac90:b029:12c:e7a:c183 with SMTP id h16-20020a170902ac90b029012c0e7ac183mr965027plr.21.1628105290885; Wed, 04 Aug 2021 12:28:10 -0700 (PDT) MIME-Version: 1.0 References: <20210715141742.15072-1-andrea.merello@gmail.com> <20210715141742.15072-3-andrea.merello@gmail.com> <20210717163236.1553fbfa@jic23-huawei> <20210724180823.692b203f@jic23-huawei> <20210731190103.6e2a3d41@jic23-huawei> <20210804175002.000059c5@Huawei.com> In-Reply-To: <20210804175002.000059c5@Huawei.com> From: Andy Shevchenko Date: Wed, 4 Aug 2021 22:27:34 +0300 Message-ID: Subject: Re: [PATCH 2/4] iio: imu: add Bosch Sensortec BNO055 core driver To: Jonathan Cameron Cc: Andrea Merello , Jonathan Cameron , Lars-Peter Clausen , Rob Herring , Matt Ranostay , Andy Shevchenko , linux-kernel , linux-iio , Andrea Merello Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 4, 2021 at 7:51 PM Jonathan Cameron wrote: > On Wed, 4 Aug 2021 12:06:46 +0200 > Andrea Merello wrote: > > Il giorno sab 31 lug 2021 alle ore 19:58 Jonathan Cameron > > ha scritto: ... > > Isn't this like doing a cut-and-paste of check+dev_err() in more than > > a dozen places in the code? > > > > If you just want more information about the caller then we could > > macroize those functions, so they can also print the caller code line > > number (or they could accept an additional argument, which is the code > > line number to print, and then a macro helper that adds that last > > argument can be used to invoke them).. But this wouldn't address your > > second point.. > It's a trade off between reviewability which these wrappers make worse > and short code. > > My personal preference is don't bother with messages on simple reg read /write > failures. If it happens you either get an error reported to userspace and > can do some more debug, or the driver doesn't probe - again, more debug to > be done even if you know it was a read or write. The advantage of regmap is that it has already established trace events. No need to add additional stuff (at least it's easy to see, read or write or what values were there). I personally put messages on regmap reads and writes in the specific cases only, when it indeed may shed a light on some events. -- With Best Regards, Andy Shevchenko