Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4842807pxb; Mon, 15 Feb 2021 02:44:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJx4BpX5HhkjLA51PXfcsmH0Xy6Djpl+ZbrQSYDnd2akCUULDLVHuTZ0DKL7xDpTCbrT8FaD X-Received: by 2002:a17:906:af15:: with SMTP id lx21mr14960193ejb.139.1613385850878; Mon, 15 Feb 2021 02:44:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613385850; cv=none; d=google.com; s=arc-20160816; b=tdniHZ0uWR24U594aID70j3mupgFDcliKVr7M/ck+z2JjqStaeFDqPFLEmoT2Hsf3p EqAa71QSmDh5OhE+vxz5MnUefEbk4K1nKyA9TI6FOMAjBI4ED9KzriKsQy+qcTUGjtHb HIlvI0TvT1seUywaCtt7Ou7E/YY80WbvmsaJTqQh3GMCszfJVdvKlSRdoItV4/2yfaC4 0oMJpYk9uIDTwXjmK36WI0AJBE7GwCQr2VOVKAxjZx3QQSGIeLrtRFi63dgKagl6FqQF d+/lQYI2q9tHswGy6e4XoaaGtk9YVVK8IQbAy7YGHW7wxz6sFg7/Vl3sER8kL+XemxHO vMEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=LMR7gu4BhtwJQ85ih0F1WtLfDgjmoVB7dObeuqGXrtQ=; b=au4CezSxiQZ3EURKIxvL5S+Ak7SvmwqmTRCZM3EJgN7kb5G/fvs8vVdtzOCMuHzJna LhKysmXE091wtWgOUltv6p3NJPwty3cSAGBgk8z0lf3RqRFS7CdzstXfAQaSiWqfJumR WNI6o8Pf2v4QCCEXalVMKc+77wrv+Rg/t0Q0JhpkQKkGnbtHx6WEqBzwwwo8WUWkp4mV rqFsbb9MZBDd6ObE4s7H7nmYttq3olELGWtHKbkNJeOi/mM+8Z7YwXfV49BsoodYwGrn No2ZN55+iiPRnnMhW3U7WJlxX3988TOAV7TJ9gF+mtXJMKZMoHg2uKqbgu+9sYey+8d/ OpVw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=analog.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e17si13097546edz.241.2021.02.15.02.43.47; Mon, 15 Feb 2021 02:44:10 -0800 (PST) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=analog.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229912AbhBOKnI (ORCPT + 99 others); Mon, 15 Feb 2021 05:43:08 -0500 Received: from mx0a-00128a01.pphosted.com ([148.163.135.77]:50146 "EHLO mx0a-00128a01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230131AbhBOKjr (ORCPT ); Mon, 15 Feb 2021 05:39:47 -0500 Received: from pps.filterd (m0167089.ppops.net [127.0.0.1]) by mx0a-00128a01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 11FAZlFd028602; Mon, 15 Feb 2021 05:38:55 -0500 Received: from nwd2mta3.analog.com ([137.71.173.56]) by mx0a-00128a01.pphosted.com with ESMTP id 36pcjamajh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 15 Feb 2021 05:38:55 -0500 Received: from SCSQMBX10.ad.analog.com (SCSQMBX10.ad.analog.com [10.77.17.5]) by nwd2mta3.analog.com (8.14.7/8.14.7) with ESMTP id 11FAcrFI023122 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 15 Feb 2021 05:38:54 -0500 Received: from SCSQCASHYB7.ad.analog.com (10.77.17.133) by SCSQMBX10.ad.analog.com (10.77.17.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.721.2; Mon, 15 Feb 2021 02:38:52 -0800 Received: from SCSQMBX11.ad.analog.com (10.77.17.10) by SCSQCASHYB7.ad.analog.com (10.77.17.133) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.2.721.2; Mon, 15 Feb 2021 02:38:52 -0800 Received: from zeus.spd.analog.com (10.66.68.11) by SCSQMBX11.ad.analog.com (10.77.17.10) with Microsoft SMTP Server id 15.1.1779.2 via Frontend Transport; Mon, 15 Feb 2021 02:38:52 -0800 Received: from localhost.localdomain ([10.48.65.12]) by zeus.spd.analog.com (8.15.1/8.15.1) with ESMTP id 11FAcQUc017530; Mon, 15 Feb 2021 05:38:49 -0500 From: Alexandru Ardelean To: , CC: , , , , , Alexandru Ardelean Subject: [PATCH v6 09/24] iio: core-trigger: make iio_device_register_trigger_consumer() an int return Date: Mon, 15 Feb 2021 12:40:28 +0200 Message-ID: <20210215104043.91251-10-alexandru.ardelean@analog.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210215104043.91251-1-alexandru.ardelean@analog.com> References: <20210215104043.91251-1-alexandru.ardelean@analog.com> MIME-Version: 1.0 Content-Type: text/plain X-ADIRuleOP-NewSCL: Rule Triggered X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.369,18.0.737 definitions=2021-02-15_03:2021-02-12,2021-02-15 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 priorityscore=1501 impostorscore=0 spamscore=0 bulkscore=0 mlxscore=0 malwarescore=0 suspectscore=0 adultscore=0 clxscore=1015 phishscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102150087 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Oddly enough the noop function is an int-return. This one seems to be void. This change converts it to int, because we want to change how groups are registered. With that change this function could error out with -ENOMEM. Signed-off-by: Alexandru Ardelean --- drivers/iio/iio_core_trigger.h | 4 +++- drivers/iio/industrialio-trigger.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/iio/iio_core_trigger.h b/drivers/iio/iio_core_trigger.h index 374816bc3e73..e1a56824e07f 100644 --- a/drivers/iio/iio_core_trigger.h +++ b/drivers/iio/iio_core_trigger.h @@ -9,8 +9,10 @@ /** * iio_device_register_trigger_consumer() - set up an iio_dev to use triggers * @indio_dev: iio_dev associated with the device that will consume the trigger + * + * Return 0 if successful, negative otherwise **/ -void iio_device_register_trigger_consumer(struct iio_dev *indio_dev); +int iio_device_register_trigger_consumer(struct iio_dev *indio_dev); /** * iio_device_unregister_trigger_consumer() - reverse the registration process diff --git a/drivers/iio/industrialio-trigger.c b/drivers/iio/industrialio-trigger.c index ea3c9859b258..438d5012e8b8 100644 --- a/drivers/iio/industrialio-trigger.c +++ b/drivers/iio/industrialio-trigger.c @@ -692,10 +692,12 @@ int iio_trigger_validate_own_device(struct iio_trigger *trig, } EXPORT_SYMBOL(iio_trigger_validate_own_device); -void iio_device_register_trigger_consumer(struct iio_dev *indio_dev) +int iio_device_register_trigger_consumer(struct iio_dev *indio_dev) { indio_dev->groups[indio_dev->groupcounter++] = &iio_trigger_consumer_attr_group; + + return 0; } void iio_device_unregister_trigger_consumer(struct iio_dev *indio_dev) -- 2.17.1